mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 04:46:04 +03:00
Minor fixes in docs
This commit is contained in:
parent
6023c0ff60
commit
e6addd4644
@ -103,7 +103,7 @@ $humanType = new ObjectType([
|
||||
```
|
||||
|
||||
In this case field definitions are created only once (as a part of Interface Type) and then
|
||||
re-used by all interface implementors. It can save several microseconds and memory + ensures that
|
||||
re-used by all interface implementors. It can save several microseconds and kilobytes + ensures that
|
||||
field definitions of Interface and implementors are always in sync.
|
||||
|
||||
Yet it creates a problem with resolution of such fields. There are two ways how shared fields could
|
||||
|
@ -21,13 +21,13 @@ $userType = new ObjectType([
|
||||
]);
|
||||
```
|
||||
|
||||
Resolvers for such fields are expected to return `array` or instance of `Traversable` interface
|
||||
(`null` is allowed by default too).
|
||||
Resolvers for such fields are expected to return `array` or instance of PHP internal `Traversable`
|
||||
interface (`null` is allowed by default too).
|
||||
|
||||
If returned value is not of one of these types - **graphql-php** will add an error to result
|
||||
and set field value to `null` (only if field is nullable, see below for non-null fields).
|
||||
|
||||
# Non-Null types
|
||||
# Non-Null fields
|
||||
By default in GraphQL every field can have `null` value. To indicate that some field always
|
||||
returns `non-null` value - use `GraphQL\Type\Definition\Type::nonNull()` modifier:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user