-
Notifications
You must be signed in to change notification settings - Fork 226
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 interface implementing interface #981
Add support for interface implementing interface #981
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool to see progress here!
modules/core/src/main/scala/sangria/introspection/package.scala
Outdated
Show resolved
Hide resolved
@yanns This is pretty much done but there are a couple of missing validations that I don't know how to handle: All the implementing fields must be declare The implementation hierarchy MUST not include loops interface Foo implement Baz {
foo: String
}
interface Bar implement Foo{
bar: String
foo: String
}
interface Baz implement Bar & Foo {
baz: String
bar: String
foo: String
} Because the materializer/builder goes in SO when trying to resolve the types. Is there a way to validate the ast before running the materializer/builder? Cheers |
Yes
I'm not sure. I'm thinking of https://github.com/sangria-graphql/sangria/pull/966/files where some validation is done on the AST directly. Does this help? |
Yep, I think so. Also, thank you to have allowed the workflow to run, I need to fix a few things :) |
cc31b4d
to
9f5dc36
Compare
|
@yanns This is ready to review. However, it is impossible to retain binary compatibility because Sangria uses case classes with default values. I have added the mima filters but I think a major version bump may be needed
I have implemented cycle detection in the AST before being materialised |
Really cool, I'll have a look at this. |
If you do a major version bump, I can remove the apply methods that meant to keep source compatibility or limit the changes. Thank you for your time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful PR, with lot of tests! 💯
description: Option[StringValue], | ||
comments: Vector[Comment], | ||
trailingComments: Vector[Comment], | ||
location: Option[AstLocation]): InterfaceTypeDefinition = new InterfaceTypeDefinition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 for taking care of "source compatibility".
I've checked that this apply is only used in tests.
modules/core/src/main/scala/sangria/schema/AstSchemaMaterializer.scala
Outdated
Show resolved
Hide resolved
Good point. |
For reference, this is in the spec since https://github.com/graphql/graphql-spec/blob/main/changelogs/October2021.md |
Fair point |
This is an initial support for #567 and supersede #597 that is based on very old base
The rendering has been a bit challenging and I took a non-standard path there