menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
Team

No support for a type implementing multiple interfaces?

October 19, 2020 at 10:51pm
The Apollo community has a new home. This thread is preserved for historical purposes. The content of this conversation may be innaccurrate or out of date. Go to new community home →

No support for a type implementing multiple interfaces?

October 19, 2020 at 10:51pm
Not sure if this belongs here or in the federation channel, so I'll start here.
My schema has a number of types that implement multiple interfaces. The spec and most graphql libraries I've used are OK with this, but I get an "Unexpected name" error when trying to upload my schema. Is this just unsupported or is there something I can do?

October 19, 2020 at 11:06pm
It's totally possible that this is a bug in our current version of composition, and one that would be a priority to fix, since it's a failure to support the specification! I think the best first step at getting this one resolved is to open up an issue with a reproduction in the Apollo federation repository (http://github.com/apollographql/federation/). To dig in a bit more, is this problem still present when doing "unmanaged" federation with a service list or only upon uploading with the CLI's service:push mechanism? Any insight into what's going wrong in more detail will help us to resolve this issue as swiftly as possible :)
I've only tried service:push so far, just started digging in this week. I'll see if I can get a small repro setup today or tomorrow.
If the interface is an entity (i.e. defines a set of fields), then each type that implements it will need to follow suit, so that could be the problem as well, potentially. I'm looking forward to digging in once you have a reproduction 🙇🏻‍♂️

October 23, 2020 at 6:48pm
I actually got past this, turns out it was an error in my syntax. The graphql-java library was happy with a comma-separated list of multiple interfaces, whereas the spec says they should be separated with a &.
For example, I had
type MyThing implements One, Two
which caused an error, but updating it to what the spec wants:
type MyThing implements One & Two
worked fine! Thanks for the quick response here, but I think it's all figured out.)
Edited