forked from webonyx/graphql-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
12 changed files
with
216 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace GraphQL\Utils; | ||
|
||
use GraphQL\Type\Definition\InterfaceType; | ||
use GraphQL\Type\Definition\ObjectType; | ||
|
||
/** | ||
* A way to track interface implementations. | ||
* | ||
* Distinguishes between implementations by ObjectTypes and InterfaceTypes. | ||
*/ | ||
class InterfaceImplementations | ||
{ | ||
|
||
/** @var ObjectType[] */ | ||
private $objects; | ||
|
||
/** @var InterfaceType[] */ | ||
private $interfaces; | ||
|
||
/** | ||
* Create a new InterfaceImplementations instance. | ||
* | ||
* @param ObjectType[] | ||
* @param InterfaceType[] | ||
*/ | ||
public function __construct(array $objects, array $interfaces) | ||
{ | ||
$this->objects = $objects; | ||
$this->interfaces = $interfaces; | ||
} | ||
|
||
/** | ||
* @return ObjectType[] | ||
*/ | ||
public function objects() : array | ||
{ | ||
return $this->objects; | ||
} | ||
|
||
/** | ||
* @return InterfaceType[] | ||
*/ | ||
public function interfaces() : array | ||
{ | ||
return $this->interfaces; | ||
} | ||
} |
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.