mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 15:59:24 +03:00
Merge branch 'master' of https://github.com/webonyx/graphql-php into v0.10
This commit is contained in:
commit
6fdcfd9bb0
@ -237,7 +237,7 @@ resolveType | `callback($value, $context, ResolveInfo $info) => objectType` | An
|
||||
|
||||
**Notes**:
|
||||
|
||||
1. If `resolveType` option is omitted, GraphQL PHP will loop through all interface implementors and use their `isTypeOf()` method to pick the first suitable one. This is obviously less efficient than single `resolveType` call. So it is recommended to define `resolveType` when possible.
|
||||
1. If `resolveType` option is omitted, GraphQL PHP will loop through all interface implementers and use their `isTypeOf()` method to pick the first suitable one. This is obviously less efficient than single `resolveType` call. So it is recommended to define `resolveType` when possible.
|
||||
|
||||
2. Interface types do not participate in data fetching. They just resolve actual `object` type which will be asked for data when GraphQL query is executed.
|
||||
|
||||
|
@ -128,6 +128,7 @@ class SyncPromiseAdapter implements PromiseAdapter
|
||||
*/
|
||||
public function wait(Promise $promise)
|
||||
{
|
||||
$this->beforeWait($promise);
|
||||
$dfdQueue = Deferred::getQueue();
|
||||
$promiseQueue = SyncPromise::getQueue();
|
||||
|
||||
@ -137,6 +138,7 @@ class SyncPromiseAdapter implements PromiseAdapter
|
||||
) {
|
||||
Deferred::runQueue();
|
||||
SyncPromise::runQueue();
|
||||
$this->onWait($promise);
|
||||
}
|
||||
|
||||
/** @var SyncPromise $syncPromise */
|
||||
@ -150,4 +152,22 @@ class SyncPromiseAdapter implements PromiseAdapter
|
||||
|
||||
throw new InvariantViolation("Could not resolve promise");
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute just before starting to run promise completion
|
||||
*
|
||||
* @param Promise $promise
|
||||
*/
|
||||
protected function beforeWait(Promise $promise)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute while running promise completion
|
||||
*
|
||||
* @param Promise $promise
|
||||
*/
|
||||
protected function onWait(Promise $promise)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user