node.js - How to organize nodeDefinition for GraphQL Server as separate files for schema? -
i have set graphql server nodejs , separated graphql schema definitions in separate files type, mutations, query , subscriptions.
|-graphqlschema |-mutations |-queries |-types
now i'm trying add nodedefitions make server relay compatible 1 client. i'm not sure on file place nodedefinitions.
if creating nodedefinition separated file, assume below problems:
- nodeinterface of nodedefinition have use resolver code of 1 in query file. (redundant codes)
- if connectiontypes defined, nodedefinition has import types , types inturn has import nodedefinition (inter-dependency).
any thoughts on organising graphql schema files modularity appreciated.
the working code available in github repo
Comments
Post a Comment