-
Is there an option to throw on type conflicts, ideally non-root types? For example: File 1 type Query {
a: A
}
type A {
field: String
} and File 2 type Query {
a: A
}
type A {
otherField: String
} When loaded using The question then, is there a way to force an error on type The use case is to enforce explicitly extending types when that is the intent and otherwise throwing an error such that developers do not accidentally implement different types (think large scale development across many different schema files intended to merge). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you want to load parts seperately, you can use const sources = await loadTypeDefs(...);
const combinedAST = sources.map(s => s.document);
const schema = buildASTSchema(combinedAST); |
Beta Was this translation helpful? Give feedback.
load
package usesmergeSchemas
under the hood which merges the schemas without respecting the order orextend
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 withconcatAST
andbuildASTSchema
.