Version: Current
Resolvers
Let's focus on resolve
functions usually called just resolvers.
With GraphQL-Modules, you implement your resolvers in the same way you do that in any other GraphQL implementation.
Modules created by GraphQL-Modules are smart enough to detect incorrect resolvers (that don't match type definitions or extensions for example). It helps you to detect duplicate and incorrect resolvers, or old resolvers that shouldn't be there.
#
Resolvers ExampleLet's take for an example the following schema for User
and Query
.
#
Dynamically Load resolvers filesIf you have many resolvers files in your module, and you wish to load it dynamically, you can use loaders from @graphql-tools/load-files
!
Start by installing this package:
Next, use it to load your files dynamically: