-
-
Notifications
You must be signed in to change notification settings - Fork 565
Allow interfaces to implement other interfaces #728
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
Comments
A PR for this would certainly be welcome. I am on the fence about this counting as a breaking change. Using the feature in the schema definitely can break clients who do not know how to deal with this spec addition. Depending on the implementation this might be non-breaking as in: users of this package can upgrade and all their code will still work. |
This will be a part of the 15.0 release as it is indeed breaking. I am going to prepare a roadmap for 15.0 with a list of issues/tasks to guide anyone willing to contribute (no ETA though). |
The only thing I can come up with is if people made their own classes to implement types that do not extend |
* Implement support for interfaces implementing interfaces Closes #728 * Implement tests for interfaces implementing interfaces This ports the JavaScript tests for `RFC: Allow interfaces to implement other interfaces` to PHP. This should ensure that there is sufficient test coverage for the changes made to support interfaces implementing interfaces. Tests taken from https://github.com/graphql/graphql-js/pull/2084/files including any typoes in test description strings to aid in comparison. * Fix extend implement interface in Parser This is part of the update to allow interfaces to implement interfaces. A single extend statement to add an implementation of an interface without field declarations is valid. This was caught by tests and brings in a change from graphql/graphql-js#2084 * Validate interface implemented ancestors Part of the work done to implement interfaces implementing interfaces. This was caught by test and improves on the previously done changes for the SchemaValidationContext by implementing `validateTypeImplementsAncestors` which was missing. * Properly apply Schema changes for interface extension support This redoes the work done for the Schema class since it was previously guessed at. It now more closely follows graphql/graphql-js/pull/2084 * Improve interface extension related typehints Co-authored-by: Benedikt Franke <[email protected]> * Refine types * Remove complex array shape type * Don't remove but deprecate DANGEROUS_CHANGE_IMPLEMENTED_INTERFACE_ADDED Removing a public constant is a breaking change and can not be implemented in a minor version. Instead the internal value is changed to ensure that existing code keeps working with the new interface implementation logic. * Don't remove but deprecate BREAKING_CHANGE_INTERFACE_REMOVED_FROM_OBJECT Co-authored-by: Benedikt Franke <[email protected]> Co-authored-by: Benedikt Franke <[email protected]>
…d advanced formating. These are few known issues: * Schema description is not yet supported by `graphql-php` (webonyx/graphql-php#1027) * "implements" for interfaces is not yet supported by Lighthouse (just for the reference webonyx/graphql-php#728)
…d advanced formating. These are few known issues: * Schema description is not yet supported by `graphql-php` (webonyx/graphql-php#1027) * "implements" for interfaces is not yet supported by Lighthouse (just for the reference webonyx/graphql-php#728)
…d advanced formating. These are few known issues: * Schema description is not yet supported by `graphql-php` (webonyx/graphql-php#1027) * "implements" for interfaces is not yet supported by Lighthouse (just for the reference webonyx/graphql-php#728)
Uh oh!
There was an error while loading. Please reload this page.
v15 of graphql-js implemented an addition to the GraphQL spec which allows interfaces to implement other interfaces. It would be nice to be able to do this in PHP as well. For example when there is a generic Node interface and a specialised Media Node type needs to be created for images, videos, etc.
graphql-js implementation: graphql/graphql-js#2084
spec addition: graphql/graphql-spec#373
Article on why this is useful: https://dev.to/mikemarcacci/intermediate-interfaces-generic-utility-types-in-graphql-50e8
The following GraphQL schema snippet currently doesn't parse but would be expected to parse after implementation.
The text was updated successfully, but these errors were encountered: