Replies: 1 comment 1 reply
-
Hey, yes, it sounds to me like you understand it correctly. The thing about an interface's Instead of referencing other GraphQL types inside (For background, interfaces don't store lists of their implementers because it would force them to all be eager-loaded in development -- but GraphQL-Ruby supports lazy-loading types as they're necessary, so that would be "bug".) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using visibility to hide portions of the schema. I've added
.visible?
to theBaseType
, which allows me to hide the majority of the schema. However, both Interfaces and Unions are still present in the Schema when they're listed as fields on theQueryType
.If I understand the documentation correctly, this is working as intended, and is called out at the bottom of the guide on Visibility:
As suggested, I've been able to hide Union fields where all possible types are hidden using something like this:
However, I'm not sure how to accomplish the same goal with an Interface. I was looking at
GraphQL::Schema::Member::HasInterfaces#interface_type_memberships
but this is always empty when I view it from the Interface's.visible?
Here's a rough example to detail the setup, and I am using version
2.5.11
.Am I understanding Union and Interface Visibility correctly? And if so, how can I check if all of the Interface implementations are visible to hide the Interface itself from the Schema?
Beta Was this translation helpful? Give feedback.
All reactions