You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| name |`string`|**Required.** Unique name of this object type within Schema |
64
-
| fields |`array` or `callable`|**Required**. An array describing object fields or callable returning such an array. See [field configuration options](#field-configuration-options) section below for expected structure of each array entry. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. |
65
-
| description |`string`| Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) |
66
-
| 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. |
67
-
| 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). |
68
-
| 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. |
69
-
| argsMapper |`callable`|**function (array $args, FieldDefinition, FieldNode): mixed**<br> Called once, when Executor resolves arguments for given field. Could be used to validate args and/or to map them to DTO/Object. |
70
-
| 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`. |
| name |`string`|**Required.** Unique name of this object type within Schema |
64
+
| fields |`array` or `callable`|**Required**. An array describing object fields or callable returning such an array. See [field configuration options](#field-configuration-options) section below for expected structure of each array entry. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. |
65
+
| description |`string`| Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) |
66
+
| 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. |
67
+
| 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). |
68
+
| 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 [Data Fetching](../data-fetching.md) for details. |
69
+
| argsMapper |`callable`|**function (array $args, FieldDefinition, FieldNode): mixed**<br> Called once, when Executor resolves arguments for given field. Could be used to validate args and/or to map them to DTO/Object. |
70
+
| 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`. |
71
71
72
72
### Field configuration options
73
73
@@ -196,15 +196,15 @@ class MyTypes
196
196
## Field Resolution
197
197
198
198
Field resolution is the primary mechanism in **graphql-php** for returning actual data for your fields.
199
-
It is implemented using **resolveField** callable in type definition or **resolve**
200
-
callable in field definition (which has precedence).
199
+
It is implemented using a **resolveField** callable in type definitions,
200
+
or a **resolve**callable in field definitions (the latter has precedence).
201
201
202
202
Read the section on [Data Fetching](../data-fetching.md) for a complete description of this process.
203
203
204
204
## Custom Metadata
205
205
206
-
All types in **graphql-php** accept configuration array. In some cases, you may be interested in
207
-
passing your own metadata for type or field definition.
206
+
All types in **graphql-php** accept a configuration array.
207
+
In some cases, you may be interested in passing your own metadata for type or field definition.
208
208
209
-
**graphql-php** preserves original configuration array in every type or field instance in
210
-
public property **$config**. Use it to implement app-level mappings and definitions.
209
+
**graphql-php** preserves the original configuration array in every type or field instance in a public property **$config**.
210
+
You may use it for custom implementations that are not natively supported by this library.
0 commit comments