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

Support interface to implement other interface #567

Closed
milliondreams opened this issue Jan 21, 2021 · 9 comments
Closed

Support interface to implement other interface #567

milliondreams opened this issue Jan 21, 2021 · 9 comments

Comments

@milliondreams
Copy link

Instead of opening an old issue (#388 & #389) which was closed since GraphQL spec in 2018 didn't support this feature #388 (comment) creating a new issue to start the discussion.

GraphQL Spec now allows (since Jan 2020) interface to implement other interfaces as documented here -
http://spec.graphql.org/draft/#sec-Interfaces.Interfaces-Implementing-Interfaces

This was merged in the spec by this PR - graphql/graphql-spec#373
and in reference JS implementation by this - graphql/graphql-js#778

Would like to know what contributors' thoughts are wrt to supporting this in Sangria. Do we review #389 or the code has changed enough to warrant a new implementation?

@yanns
Copy link
Contributor

yanns commented Jan 21, 2021

Someone has to take to time to open a new PR (can be based on #389) starting from the last version.

@nickhudkins
Copy link
Contributor

Hey @milliondreams we're limited in our contributors right now, but generally speaking, we absolutely would like to keep up with the spec.

I suspect #389 may be old enough that a rebase / merge would be difficult, though we'd welcome a fresh PR.

Additionally, I agree with @OlegIlyenko's review that the original PR got a bit unwieldy to review. Anything that can be done to make the change more targeted would be welcomed greatly.

@titaniumcoder
Copy link

Is there someone already working on that one? Else I would take a look at the old PR and continue from there and see whether I can put together a PR.

@yanns
Copy link
Contributor

yanns commented Feb 2, 2021

Is there someone already working on that one? Else I would take a look at the old PR and continue from there and see whether I can put together a PR.

I'm not aware of anyone working on that.
Thanks for proposing!

@titaniumcoder
Copy link

I have a question regarding how things are handled in Sangria. In my opinion (and with just copying lot of the examples from the GraphQL JS reference implementation), the following should probably cover most cases. But how do you handle things like the last two situations where in my opinion, the specification right now is not (yet) clear:

interface Being {
    name(surname: Boolean): String
}
interface Mammal {
    mother: Mammal
    father: Mammal
}
interface Pet implements Being {
    name(surname: Boolean): String
}

interface Canine implements Mammal & Being {
    name(surname: Boolean): String
    mother: Canine
    father: Canine
}

type Dog implements Being & Pet & Mammal & Canine {
    name(surname: Boolean): String
    nickname: String
    mother: Dog
    father: Dog
}

interface Bar {
  one: Int
  four(argument: String = "string"): String
}

interface Two {
  two(argument: String!): Int
}

extend interface Bar implements Two {
  two(argument: String!): Int
}

"""
Invalid (already there but as of today, the Spec is not clear about this...)
"""
extend interface Bar implements Two {
    three(argument: InputType!): Type
}

"""
Probably Invalid because it's missing Mammal
"""
interface BigCanine implements Canine & Being {
    mother: Being # probably invalid
    father: BigCanine
}

@yanns
Copy link
Contributor

yanns commented Jul 20, 2021

@titaniumcoder I don't know. Maybe you could ask on graphql/graphql-spec#373 ?

@yanns
Copy link
Contributor

yanns commented Sep 27, 2022

@titaniumcoder are you working on the PR?

@titaniumcoder
Copy link

@yanns nope, we didn't need it the feature in the end, should have mentioned it, sorry.

filosganga added a commit to filosganga/sangria that referenced this issue Mar 29, 2023
filosganga added a commit to filosganga/sangria that referenced this issue Mar 29, 2023
filosganga added a commit to filosganga/sangria that referenced this issue Mar 29, 2023
@yanns
Copy link
Contributor

yanns commented Mar 30, 2023

released in https://github.com/sangria-graphql/sangria/releases/tag/v4.0.0-RC1

@yanns yanns closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants