These utils are useful for scanning, loading and building a GraphQL schema from any input.
You can specify a GraphQL endpoint, local introspection JSON file, code file that
exports a GraphQLSchema, AST string and
.graphql files (with support for
All found schema files can be merged into a complete schema. There is support for
#import syntax (formerly known as
The user is given the option of implementing their own loader (implement the interface
The schema loading util is using loaders, and implemented using chain-of-responsibility pattern.
Specifying the loader is not necessary. The user need only provide the inputs. The utils will detect it automatically.
Assume the following directory structure:
loadSchema produces the following output:
You can extend loaded schema with resolvers
You can learn more about loaders to load schemas from different sources.