graphql-ruby
graphql-ruby copied to clipboard
Missing field for mutation if returning interface with no implementations
I had a mutation with an interface as the return type, but forgot to add the implements MyInterface declaration to any types. As a result, when I tried to call the mutation, I got back an error that there was no such field.
My bad for forgetting to add the declarations, but I wish that there would have been some kind of a warning or error instead of silently ignoring the mutation type
Sorry for the nasty surprise! It's technically a feature -- we support dynamically hiding some parts of the schema, and as you noticed, when all of an interface's implementors are hidden, we hide that too.
Maybe some better approaches are:
- When building a schema, if we find an interface with no implementations, give a warning
- Build a verbose log (#2286) which outputs this information into the Rails terminal
I haven't addressed this yet, but for paperwork purposes, I'm going to close this issue since it's covered by #2817