Thanks for the update on this change. I think we already support this in _implemenation_ via:
module SomeGeneralInterface
include GraphQL::Schema::Interface
end
module SomeSpecificInterface
include SomeGeneralInterface
end
(I think that will give SomeSpecificInterface _all_ the fields from SomeGeneralInterface, along with its own fields.)
But, we could make it first-class graphql with:
implements(...) to interface definition modules;implements(...) is used, track the parent interface in the child's self.interfaces (just like GraphQL::Schema::Object -- maybe it could be extracted out into GraphQL::Schema::Member::HasInterfaces)If you want to take a crack at it, go for it!
The above example does not translate well client-side. (Well, I assume GraphQL's update does accounts for the following, would be a big miss if not!)
If the schema requires a field be of type SomeGeneralInterface, one cannot say implements SomeSpecificInterface and satisfy this.
Looks like the spec has been updated to accommodate this!
Although we can side-step the issue by including the interface into another interface, the outputted GraphQL schema is incorrect. We need to support implements within an interface definition module to support the behaviour properly.
E.g.
module Savable
include(GraphQL::Schema::Interface)
include(GraphQL::Types::Relay::Node)
field :is_saved, Boolean, null: false
end
```graphql
interface Savable {
id: ID,
isSaved: Boolean
}
However, it should actually be this:
```graphql
interface Savable implements Node {
id: ID,
isSaved: Boolean
}
Most helpful comment
Thanks for the update on this change. I think we already support this in _implemenation_ via:
(I think that will give
SomeSpecificInterface_all_ the fields fromSomeGeneralInterface, along with its own fields.)But, we could make it first-class graphql with:
implements(...)to interface definition modules;implements(...)is used, track the parent interface in the child'sself.interfaces(just likeGraphQL::Schema::Object-- maybe it could be extracted out intoGraphQL::Schema::Member::HasInterfaces)If you want to take a crack at it, go for it!