Skip to content
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

Interfaces cannot implement other interfaces #269

Open
ValentinVignal opened this issue Sep 24, 2021 · 3 comments
Open

Interfaces cannot implement other interfaces #269

ValentinVignal opened this issue Sep 24, 2021 · 3 comments

Comments

@ValentinVignal
Copy link
Contributor

I'm generating my schema.graphql file with nestjs graphql: https://github.com/nestjs/graphql which supports interfaces implementing other interfaces:

interface Interface0 {
   field0: String
}

interface Interface1 implements Interface0 {
   field0: String
   field1: Float!
}

interface Interface2 implements Interface0 & Interface1 {
   field0: String
   field1: Float!
   field2: Float
}

type Type0 implements & Interface0 & Interface1 & Interface2 {
   field0: String
   field1: Float!
   field2: Float
}

But it looks like it is not supported by this package:

Error on line xx, column yy of package:my_project/schema.graphql: Unknown definition type 'implements'
   ╷
16 │ interface Interface2 implements Interface0 & Interface1 {
   │                      ^^^^^^^^^^
   ╵

(Right now, I'm using the version 0.9.4)
Is there something I should do to make it work, or is it planned to support it in the future?

@smkhalsa smkhalsa transferred this issue from gql-dart/ferry Sep 24, 2021
@smkhalsa
Copy link
Member

First of all, I moved this to the gql repo since it relates to the gql/language code, not ferry directly.

The feature of interfaces implementing other interfaces hasn't made it into the official GraphQL spec yet.

They are included in the current working draft though, so we can reasonably expect them in the next official spec release. As such, I think it would be reasonable to just go ahead and implement this feature now.

I don't have the time to work on this, but I can provide guidance if you'd like to make a PR, or maybe one of the other maintainers of gql wants to take it on.

@ValentinVignal
Copy link
Contributor Author

Awesome ,I'm very glad to hear that. Thank you for this quick response. I don't have the time to work on it right now though. I might give it a try in a while if no one started in the meantime.

@tlvenn
Copy link

tlvenn commented Apr 4, 2022

Would be great to add support for this, it is now part of the official spec since October 2021.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants