GraphQL schema endpoint lacks support for intermediate interfaces (new in GraphQL 15.0.0)

Moved from GitHub dgraph/5353

Posted by CosmicPangolin:

What version of Dgraph are you using?

20.03.1

Have you tried reproducing the issue with the latest release?

Yep

What is the hardware spec (RAM, OS)?

N/A

Steps to reproduce the issue (command/config used to run Dgraph).

Build a GraphQL 15.0.0-compliant schema with an intermediate interface, attempt curl post
eg -

interface Bar {
}

interface Foo implements Bar {
}

Expected behaviour and actual result.

Expected: schema loaded with all relevant interface types/fields generated
Result: Unexpected name \"implements\"

Pretty clear, methinks. Filing under bug and not feature to prioritize since this is a spec-compliance issue as of GraphQL 15.0.0 and has a large impact on schema expressiveness.

MichaelJCompton commented :

Hi, thanks for adding the issue.

I agree that this is cool new thing, but it’s not a spec compliance issue and isn’t in the current GraphQL spec.

I think the right way forward for us is to try and get it supported in Golang GraphQL parser and then roll that support into our GraphQL. I can’t make any assessment of how that will work because I don’t know if they will take PRs for upcoming features or if they will wait till it is released in the GraphQL spec.

Short answer: yes we’d like to support it

Long answer: read the gory details below…


Here’s the back story: Interfaces that implement interfaces was only accepted by the GraphQL working group a month or two ago and is now in the working draft for the next version of the spec - the current spec doesn’t include this feature.

As such, it has made it’s way into GraphQL-js (because nothing can make its way into the draft spec until it’s supported by that implementation). So it’s in GraphQL-js 15.0.0 and will be in the next version of the GraphQL spec when it comes along … but it’s an upcoming feature, not a current feature.

The long and short of that is that because it’s not in the current spec it isn’t supported yet by GraphQL community - it’s not in GraphQL Go libraries, not in GraphQL Java, etc. etc.

We use gqlparser to parse and validate GraphQL schemas, so the process would have to involve getting it supported there first. No idea yet how that process will work.

It’s a cool new thing. So we’ll look into it. But the first pass depends on external support, so we’ll have to look there first.