Skip to content

Commit fca3968

Browse files
committed
Add doc
1 parent 69d3352 commit fca3968

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ isTypeOf | `callback($value, $context, GraphQL\Type\Definition\ResolveInfo $info
305305

306306
2. Object types are responsible for data fetching. Each of their fields may have optional `resolve` callback option. This callback takes `$value` that corresponds to instance of this type and returns `data` accepted by type of given field.
307307
If `resolve` option is not set, GraphQL will try to get `data` from `$value[$fieldName]`.
308+
`resolve` result can also be a promise implementing the interface `GraphQL\Promise\PromiseInterface`. If the result is a promise the executor will wait for
309+
promise to complete before continuing.
308310

309311
3. `resolve` callback is a place where you can use your existing data fetching logic. `$context` is defined by your application on the top level of query execution (useful for storing current user, environment details, etc)
310312

0 commit comments

Comments
 (0)