There are multiple ways to load your schema, and GraphQL Modules tries to make it easy for you.
You can use
graphql-toolkit, it has a powerful mechanism for finding and loading your schema and resolvers files.
sonar, you can separate your GraphQL schema definition and resolvers to smaller parts, and load them without directly specifying files.
For example, given the following structure:
You can easily load all of your
.graphql files and
.ts resolvers files like below:
This way, you don't have to specify each file and each resolver; the tools will do it for you.
Using imports and
You can also write your schema and resolvers in different files and then import them using graphql-import-node:
As a string
The simplest way to load your schema and resolvers into a module is to write them directly on your