Minor fixes in docs

This commit is contained in:
vladar 2016-11-07 18:23:59 +07:00
parent 6023c0ff60
commit e6addd4644
2 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ $humanType = new ObjectType([
``` ```
In this case field definitions are created only once (as a part of Interface Type) and then 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. 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 Yet it creates a problem with resolution of such fields. There are two ways how shared fields could

View File

@ -21,13 +21,13 @@ $userType = new ObjectType([
]); ]);
``` ```
Resolvers for such fields are expected to return `array` or instance of `Traversable` interface Resolvers for such fields are expected to return `array` or instance of PHP internal `Traversable`
(`null` is allowed by default too). 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 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). 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 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: returns `non-null` value - use `GraphQL\Type\Definition\Type::nonNull()` modifier: