Skip to content
Discussion options

You must be logged in to vote

Hey, yes, it sounds to me like you understand it correctly.

The thing about an interface's interface_type_memberships is that it would contain other interfaces which this interface implements, not the objects that implement this interface.

Instead of referencing other GraphQL types inside .visible?, could you call the same code that those object types call in their .visible? methods? For example, if Types::Text checks can_see_text? and Types::Image checks can_see_images?, then Types::Post could check can_see_text? || can_see_images?.

(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 sup…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@timlkelly
Comment options

Answer selected by timlkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants