Skip to content
Discussion options

You must be logged in to vote

I think I found the solution - Schema Merging using @graphql/tools packages.

const path = require('path') const { loadFilesSync } = require('@graphql-tools/load-files') const { mergeTypeDefs } = require('@graphql-tools/merge') const typesArray = loadFilesSync(path.join(__dirname, './types'), { extensions: ['graphql'] }) const mergedSchema = mergeTypeDefs(typesArray); const printedSchema = print(mergedSchema); // write printedSchema to a `schema.graphql` file 

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@PaulRBerg
Comment options

@PaulRBerg
Comment options

Answer selected by PaulRBerg
@PaulRBerg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants