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
When we enable GraphQL::Schema::Visibility our types can no longer be used in fragments on interfaces implemented by the parent classes. But in the schema they are still listed as implementing the interface.
We get the following error when trying to use the fragments, which work if we don't enable visibility: Fragment on Person can't be spread inside Node
Versions
graphql version: 2.4.9 rails (or other framework): 7.1
other applicable versions (graphql-batch, etc): none
GraphQL schema
Include relevant types and fields (in Ruby is best, in GraphQL IDL is ok). Any custom extensions, etc?
Error with message Fragment on Person can't be spread inside Node
Expected behavior
Query result (either null if person with id abc cannot be found or id and name if one is found)
Actual behavior
We get an error
Additional context
When I add the following line to the Person class it works as expected: implements(GraphQL::Types::Relay::Node)
But in my actual schema I have a lot of types that should all implement the Node interface and I don't want to repeat myself each time, that's why I created the superclass. This works if I don't add use(GraphQL::Schema::Visibility) to my schema.
What I see in the schema for Person (even with visibility enabled), so this seems OK: type Person implements Node {
The text was updated successfully, but these errors were encountered:
Describe the bug
When we enable
GraphQL::Schema::Visibility
our types can no longer be used in fragments on interfaces implemented by the parent classes. But in the schema they are still listed as implementing the interface.We get the following error when trying to use the fragments, which work if we don't enable visibility:
Fragment on Person can't be spread inside Node
Versions
graphql
version: 2.4.9rails
(or other framework): 7.1other applicable versions (
graphql-batch
, etc): noneGraphQL schema
Include relevant types and fields (in Ruby is best, in GraphQL IDL is ok). Any custom extensions, etc?
GraphQL query
Example GraphQL query and response (if query execution is involved)
Error with message
Fragment on Person can't be spread inside Node
Expected behavior
Query result (either null if person with id
abc
cannot be found orid
andname
if one is found)Actual behavior
We get an error
Additional context
When I add the following line to the
Person
class it works as expected:implements(GraphQL::Types::Relay::Node)
But in my actual schema I have a lot of types that should all implement the Node interface and I don't want to repeat myself each time, that's why I created the superclass. This works if I don't add
use(GraphQL::Schema::Visibility)
to my schema.What I see in the schema for Person (even with visibility enabled), so this seems OK:
type Person implements Node {
The text was updated successfully, but these errors were encountered: