You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
TL;DR
For an interface type, the possibleTypes should be captured in InterfaceTypeDefinition by IntrospectionResultToSchema.
Details:
When introspecting an interface type, the introspection result would look like (example taken from this test):
{
"kind": "INTERFACE",
"name": "Character",
"description": "A character in the Star Wars Trilogy",
"fields": [
{
"name": "id",
"description": "The id of the character.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
...
],
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": [
{
"kind": "OBJECT",
"name": "Human",
"ofType": null
},
{
"kind": "OBJECT",
"name": "Droid",
"ofType": null
}
]
}
The IntrospectionResultToSchema#createSchemaDefinition can parse the introspection result and returns the InterfaceTypeDefinition object. However, the possibleTypes are lost during the parsing. In fact, the InterfaceTypeDefinition class itself does not contain a data structure to capture possible types at all (as compared to the UnionTypeDefinition which contains memberTypes that is used to contain possible types).
This would make it difficult to analyze GraphQL types programmatically because of the missing possible types information.
To Reproduce
Run IntrospectionResultToSchemaTest and look at interfaceTypeDefinition variable, it cannot return a list of possible types ([Human, Droid]).
The text was updated successfully, but these errors were encountered:
Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.
Library version: v16.1
Describe the bug
TL;DR
For an interface type, the
possibleTypes
should be captured inInterfaceTypeDefinition
byIntrospectionResultToSchema
.Details:
When introspecting an interface type, the introspection result would look like (example taken from this test):
The
IntrospectionResultToSchema#createSchemaDefinition
can parse the introspection result and returns theInterfaceTypeDefinition
object. However, thepossibleTypes
are lost during the parsing. In fact, theInterfaceTypeDefinition
class itself does not contain a data structure to capture possible types at all (as compared to theUnionTypeDefinition
which containsmemberTypes
that is used to contain possible types).This would make it difficult to analyze GraphQL types programmatically because of the missing possible types information.
To Reproduce
Run
IntrospectionResultToSchemaTest
and look atinterfaceTypeDefinition
variable, it cannot return a list of possible types ([Human
,Droid
]).The text was updated successfully, but these errors were encountered: