Skip to content

@graphql-tools/load detect type conflicts #4621

Answered by ardatan
tlivings asked this question in Q&A
Discussion options

You must be logged in to vote

load package uses mergeSchemas under the hood which merges the schemas without respecting the order or extend operator, because it is basically a schema merger not a schema builder.

If you want to load parts seperately, you can use loadTypeDefs and build the schema on your own with concatAST and buildASTSchema.

const sources = await loadTypeDefs(...);
const combinedAST = sources.map(s => s.document);
const schema = buildASTSchema(combinedAST);

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tlivings
Comment options

@ardatan
Comment options

Answer selected by ardatan
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