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
Introspection only supports type kinds defined by spec. I am not sure if we should support custom extensions like this. Did you try it with existing tools like GraphiQL? Does it work?
No it's the issue, since it's throwing an exception, GraphiQL doesn't work.
The other solution would be to implement this type in graphql-php directly, even if it's not in the spec yet.
I think there's really a need for this, there's even a pending RFC here: graphql/graphql-spec#395 (see also graphql/graphql-js#207).
I do agree that input union is a useful thing and I miss them myself. But I don't agree that we should allow non-spec-compliant custom type kinds in the base library.
The way to go for this kind of change is to support the RFC you posted previously and have it included in the spec eventually.
It should be possible to create a new kind of type without having the error
Unknown kind of type: MyCustomType
when introspecting the schema (see https://github.com/webonyx/graphql-php/blob/master/src/Type/Introspection.php#L419).For example, we have this type in API Platform: https://github.com/api-platform/core/blob/master/src/GraphQl/Type/Definition/InputUnionType.php
And we can't introspect the schema because of the use of this new type.
We should at least be able to extend easily the related parts (not the case since it's inside an anonymous function).
The text was updated successfully, but these errors were encountered: