-
-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for interfaces implementing interfaces (#740)
* 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]>
- Loading branch information
1 parent
769a474
commit c4d2f82
Showing
41 changed files
with
1,908 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace GraphQL\Type\Definition; | ||
|
||
/** | ||
export type GraphQLImplementingType = | ||
GraphQLObjectType | | ||
GraphQLInterfaceType; | ||
*/ | ||
interface ImplementingType | ||
{ | ||
public function implementsInterface(InterfaceType $interfaceType) : bool; | ||
|
||
/** | ||
* @return array<int, InterfaceType> | ||
*/ | ||
public function getInterfaces() : array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.