-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Description
Issue Description
If you use graphql-js to define a schema with an interface (GraphQLInterfaceType) and then buildSubgraphSchema to build a subgraph, interface's resolveType in the schema are not being copied over, which leads to the runtime error:
"Abstract type \"Character\" must resolve to an Object type at runtime for field \"Query.character\". Either the \"Character\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."
I created https://github.com/juampynr/subgraph-interface to illustrate this bug.
Link to Reproduction
https://github.com/juampynr/subgraph-interface
Reproduction Steps
Run the following commands to see the error:
git clone [email protected]:juampynr/subgraph-interface.git
cd subgraph-interface
nvm use
npm i
node index.js
curl --location 'http://localhost:4000/graphql' \
--header 'Content-Type: application/json' \
--data '{"query":"query {\n character(id: \"1\") {\n id\n name\n ... on Hero {\n superpower\n }\n ... on Villain {\n evilPlan\n }\n }\n}","variables":{}}'
opiuman, q0rban and deviantintegral
Metadata
Metadata
Assignees
Labels
No labels