-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments for GraphQL Union vs. Interface #522
Comments
Hi, I've read your blog post and trying to implement something similar to the interface example you are sharing. I was wondering if you could share what the QueryType class looks like in the interface example as I'd like to understand what should be the type for the instruments field:
|
@alice-letourneur the type of |
Thanks a lot for your answer, helped a lot, the issue I was having was actually the same as what you are describing at the end of the post, I just didn't realise it was:
Read more about it here: https://graphql-ruby.org/type_definitions/interfaces#orphan-types and all makes sense now. |
Oh yes! I remember that now! Yes, because these types are not directly accessed in our schema, they won't be included in the final schema unless we define them as Orphan Types. Happy that your problem is solved 😍 |
The example links that were posted now show 404 errors. I am under the impression that the interfaces can define fields and the objects can inherit the fields keeping the code DRY. I am unable to query the fields on the objects implementing the interface. I was hoping to look at the examples as I wasn't able to find what I was looking for on graphql-ruby.org |
yes @kendallcarey , there are some examples here where Sorry about 404s, that repository this post is referring to is not public anymore 😞 |
Thank you, I have been using that resource to create interfaces. I ended creating a stackoverflow question based on issues that I've been having: https://stackoverflow.com/questions/69715042/graphql-ruby-creating-interfaces-that-objects-can-inherit-fields-from Am I misunderstanding interfaces? |
Replied to you on that thread. |
Thank you so much! I can't tell you how grateful I am for your help. I responded! |
The text was updated successfully, but these errors were encountered: