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

Add support for interfaces on interfaces #1304

Merged

Conversation

AlecRosenbaum
Copy link
Contributor

graphql-core already supports specifying interfaces on interfaces. This change adds that support to graphene.

For example, the interfaces from one of the added test cases would look like this in a printed schema:

interface FooInterface {
  foo: String
}

interface BarInterface implements FooInterface {
  foo: String
  bar: String
}

I've tested these changes with a private schema and it seems to work as expected. There's some trickiness around getting graphql-core to resolve types properly but it's definitely doable.

Copy link
Contributor

@zbyte64 zbyte64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely a nice to have feature 🚀

This was referenced Jan 19, 2021
Copy link
Member

@erikwrede erikwrede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long wait, this looks great!

@erikwrede erikwrede merged commit c77d87d into graphql-python:master Aug 13, 2022
erikwrede added a commit to erikwrede/graphene that referenced this pull request Aug 13, 2022
erikwrede added a commit that referenced this pull request Aug 13, 2022
assert bar_graphql_type.interfaces == [foo_graphql_type] failed only on tox, because .interfaces was a tuple instead of a list. Error didn't occur using just pytest. Fixed by explicitly
converting both to list.
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

Successfully merging this pull request may close these issues.

3 participants