Created
January 22, 2022 20:04
-
-
Save colinfwren/430722b7cb578d9cd7bd7b40eb888ab0 to your computer and use it in GitHub Desktop.
Loading GraphQL schema from Library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {loadTypedefsSync} from "@graphql-tools/load"; | |
import {GraphQLFileLoader} from "@graphql-tools/graphql-file-loader"; | |
const sources = loadTypedefsSync("node_modules/@your-org/graphql-schema/schema.graphql", { | |
loaders: [new GraphQLFileLoader()], | |
}); | |
const typeDefs = sources.map((source) => source.document); | |
const resolvers = {} | |
const graphQLConfig = { | |
typeDefs, | |
resolvers, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment