Skip to content

Commit

Permalink
Update docs/type-definitions/object-types.md
Browse files Browse the repository at this point in the history
Co-authored-by: Benedikt Franke <[email protected]>
  • Loading branch information
carlagouveia and spawnia authored Sep 29, 2023
1 parent 2f1a131 commit 37eb433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/type-definitions/object-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ This example uses **inline** style for Object Type definitions, but you can also
| interfaces | `array` or `callable` | List of interfaces implemented by this type or callable returning such a list. See [Interface Types](interfaces.md) for details. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. |
| isTypeOf | `callable` | **function ($value, $context, [ResolveInfo](../class-reference.md#graphqltypedefinitionresolveinfo) $info): bool**<br> Expected to return **true** if **$value** qualifies for this type (see section about [Abstract Type Resolution](interfaces.md#interface-role-in-data-fetching) for explanation). |
| resolveField | `callable` | **function ($value, array $args, $context, [ResolveInfo](../class-reference.md#graphqltypedefinitionresolveinfo) $info): mixed**<br> Given the **$value** of this type, it is expected to return value for a field defined in **$info->fieldName**. A good place to define a type-specific strategy for field resolution. See section on [Data Fetching](../data-fetching.md) for details. |
| visible | `bool` or `callable` | **function ($context): mixed**<br> You can customize the visibility of fields by defining them as visible or not visible using a `bool` or your own custom logic by sending a `callable` that receives the `$context`. In introspection, the field will not be included in the result and if a query references that field, it will return a validation error. |
| visible | `bool` or `callable` | Defaults to `true`. The given callable receives no arguments and is expected to return a `bool`, it is called once when the field may be accessed. The field is treated as if it were not defined at all when this is `false`. |

### Field configuration options

Expand Down

0 comments on commit 37eb433

Please sign in to comment.