mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-29 00:25:17 +03:00
Fix interface implementaion when interface is extends.
This commit is contained in:
parent
327cc52601
commit
de4eba7077
@ -49,8 +49,9 @@ class InterfaceType extends Type implements AbstractType, OutputType, CompositeT
|
||||
public static function addImplementationToInterfaces(ObjectType $impl)
|
||||
{
|
||||
self::$_lazyLoadImplementations[] = function() use ($impl) {
|
||||
/** @var self $interface */
|
||||
foreach ($impl->getInterfaces() as $interface) {
|
||||
$interface->_implementations[] = $impl;
|
||||
$interface->addImplementation($impl);
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -66,6 +67,16 @@ class InterfaceType extends Type implements AbstractType, OutputType, CompositeT
|
||||
self::$_lazyLoadImplementations = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a implemented object type to interface
|
||||
*
|
||||
* @param ObjectType $impl
|
||||
*/
|
||||
protected function addImplementation(ObjectType $impl)
|
||||
{
|
||||
$this->_implementations[] = $impl;
|
||||
}
|
||||
|
||||
/**
|
||||
* InterfaceType constructor.
|
||||
* @param array $config
|
||||
|
Loading…
Reference in New Issue
Block a user