-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
Hey guys, thanks for maintaining the tools herein.
We've noticed that stitchSchemas
doesn't seem to preserve @oneOf
. Repro:
import {stitchSchemas} from '@graphql-tools/stitch';
import {buildSchema, printSchema} from 'graphql';
const schemaSrc = `
type Query {
findPerson(in: FindPersonInput): Person
findPersonById(id: String): Person @deprecated(reason: "use findPerson")
}
type Person {
Name: String
ID: String
}
input FindPersonInput @oneOf {
byId: String
byName: String
}
`;
const schema = buildSchema(schemaSrc);
const stitchedSchema = stitchSchemas({subschemas: [schema]});
console.log(printSchema(schema));
console.log('-----------')
console.log(printSchema(stitchedSchema));
Output:
type Query {
findPerson(in: FindPersonInput): Person
findPersonById(id: String): Person @deprecated(reason: "use findPerson")
}
type Person {
Name: String
ID: String
}
input FindPersonInput @oneOf {
byId: String
byName: String
}
-----------
type Query {
findPerson(in: FindPersonInput): Person
findPersonById(id: String): Person @deprecated(reason: "use findPerson")
}
type Person {
Name: String
ID: String
}
input FindPersonInput { # <--- missing @oneOf!
byId: String
byName: String
}
Any reason why this is the case? I've included a @deprecated
as a demo of another built-in directive that seems to work out of the box.
Cheers!
package.json:
{
"name": "stitchbug",
"version": "1.0.0",
"description": "",
"license": "ISC",
"dependencies": {
"@graphql-tools/stitch": "^9.4.28",
"graphql": "^16.11.0"
},
"devDependencies": {
"tsx": "^4.20.5",
"typescript": "^5.9.2"
}
}
Metadata
Metadata
Assignees
Labels
No labels