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
Copy file name to clipboardExpand all lines: docs/complementary-tools.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Integrations
2
2
3
-
*[Standard Server](executing-queries.md/#using-server) – Out of the box integration with any PSR-7 compatible framework (like [Slim](http://slimframework.com) or [Zend Expressive](http://zendframework.github.io/zend-expressive/)).
3
+
*[Standard Server](executing-queries.md#using-server) – Out of the box integration with any PSR-7 compatible framework (like [Slim](http://slimframework.com) or [Zend Expressive](http://zendframework.github.io/zend-expressive/)).
4
4
*[Relay Library for graphql-php](https://github.com/ivome/graphql-relay-php) – Helps construct Relay related schema definitions.
5
5
*[Lighthouse](https://github.com/nuwave/lighthouse) – Laravel based, uses Schema Definition Language
6
6
*[Laravel GraphQL](https://github.com/rebing/graphql-laravel) - Laravel wrapper for Facebook's GraphQL
Copy file name to clipboardExpand all lines: docs/executing-queries.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Description of **executeQuery** method arguments:
37
37
38
38
Argument | Type | Notes
39
39
------------ | -------- | -----
40
-
schema | [`GraphQL\Type\Schema`](#) | **Required.** Instance of your application [Schema](schema-definition.md)
40
+
schema | [`GraphQL\Type\Schema`](class-reference.md#graphqltypeschema) | **Required.** Instance of your application [Schema](schema-definition.md)
41
41
queryString | `string` or `GraphQL\Language\AST\DocumentNode` | **Required.** Actual GraphQL query string to be parsed, validated and executed. If you parse query elsewhere before executing - pass corresponding AST document here to avoid new parsing.
42
42
rootValue | `mixed` | Any value that represents a root of your data graph. It is passed as the 1st argument to field resolvers of [Query type](schema-definition.md#query-and-mutation-types). Can be omitted or set to null if actual root values are fetched by Query type itself.
43
43
context | `mixed` | Any value that holds information shared between all field resolvers. Most often they use it to pass currently logged in user, locale details, etc.<br><br>It will be available as the 3rd argument in all field resolvers. (see section on [Field Definitions](type-definitions/object-types.md#field-configuration-options) for reference) **graphql-php** never modifies this value and passes it *as is* to all underlying resolvers.
@@ -95,7 +95,7 @@ PSR-7 is useful when you want to integrate the server into existing framework:
95
95
96
96
Argument | Type | Notes
97
97
------------ | -------- | -----
98
-
schema | [`Schema`](class-reference.md#graphqltypeschema) | **Required.** Instance of your application [Schema](type-definitions/schema/)
98
+
schema | [`Schema`](class-reference.md#graphqltypeschema) | **Required.** Instance of your application [Schema](schema-definition.md)
99
99
rootValue | `mixed` | Any value that represents a root of your data graph. It is passed as the 1st argument to field resolvers of [Query type](schema-definition.md#query-and-mutation-types). Can be omitted or set to null if actual root values are fetched by Query type itself.
100
100
context | `mixed` | Any value that holds information shared between all field resolvers. Most often they use it to pass currently logged in user, locale details, etc.<br><br>It will be available as the 3rd argument in all field resolvers. (see section on [Field Definitions](type-definitions/object-types.md#field-configuration-options) for reference) **graphql-php** never modifies this value and passes it *as is* to all underlying resolvers.
101
101
fieldResolver | `callable` | A resolver function to use when one is not provided by the schema. If not provided, the [default field resolver is used](data-fetching.md#default-field-resolver).
@@ -105,7 +105,7 @@ debugFlag | `int` | Debug flags. See [docs on error debugging](error-handling.md
105
105
persistentQueryLoader | `callable` | A function which is called to fetch actual query when server encounters **queryId** in request vs **query**.<br><br> The server does not implement persistence part (which you will have to build on your own), but it allows you to execute queries which were persisted previously.<br><br> Expected function signature:<br> **function ($queryId, [OperationParams](class-reference.md#graphqlserveroperationparams) $params)** <br><br>Function is expected to return query **string** or parsed **DocumentNode** <br><br> [Read more about persisted queries](https://dev-blog.apollodata.com/persisted-graphql-queries-with-apollo-client-119fd7e6bba5).
Copy file name to clipboardExpand all lines: docs/type-definitions/object-types.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Conceptually Object Type is a collection of Fields. Each field, in turn,
5
5
has its own type which allows building complex hierarchies.
6
6
7
7
In **graphql-php** object type is an instance of `GraphQL\Type\Definition\ObjectType`
8
-
(or one of it subclasses) which accepts configuration array in constructor:
8
+
(or one of its subclasses) which accepts a configuration array in its constructor:
9
9
10
10
```php
11
11
<?php
@@ -57,36 +57,32 @@ $blogStory = new ObjectType([
57
57
]);
58
58
```
59
59
This example uses **inline** style for Object Type definitions, but you can also use
60
-
[inheritance or schema definition language](introduction.md#definition-styles).
60
+
[inheritance or schema definition language](index.md#definition-styles).
61
61
62
62
# Configuration options
63
-
Object type constructor expects configuration array. Below is a full list of available options:
64
63
65
64
Option | Type | Notes
66
65
------------ | -------- | -----
67
66
name | `string` | **Required.** Unique name of this object type within Schema
68
-
fields | `array` or `callable` | **Required**. An array describing object fields or callable returning such an array. See [Fields](#field-definitions) 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.
67
+
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.
69
68
description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation)
70
69
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.
71
70
isTypeOf | `callable` | **function($value, $context, [ResolveInfo](../class-reference.md#graphqltypedefinitionresolveinfo) $info)**<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).
72
71
resolveField | `callable` | **function($value, $args, $context, [ResolveInfo](../class-reference.md#graphqltypedefinitionresolveinfo) $info)**<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.
73
72
74
-
# Field configuration options
75
-
Below is a full list of available field configuration options:
73
+
## Field configuration options
76
74
77
75
Option | Type | Notes
78
76
------ | ---- | -----
79
77
name | `string` | **Required.** Name of the field. When not set - inferred from **fields** array key (read about [shorthand field definition](#shorthand-field-definitions) below)
80
78
type | `Type` | **Required.** An instance of internal or custom type. Note: type must be represented by a single instance within one schema (see also [lazy loading of types](../schema-definition.md#lazy-loading-of-types))
81
-
args | `array` | An array of possible type arguments. Each entry is expected to be an array with keys: **name**, **type**, **description**, **defaultValue**. See [Field Arguments](#field-arguments) section below.
79
+
args | `array` | An array describing any number of possible field arguments, each element being an array. See [field argument configuration options](#field-argument-configuration-options).
82
80
resolve | `callable` | **function($objectValue, $args, $context, [ResolveInfo](../class-reference.md#graphqltypedefinitionresolveinfo) $info)**<br> Given the **$objectValue** of this type, it is expected to return actual value of the current field. See section on [Data Fetching](../data-fetching.md) for details
83
81
complexity | `callable` | **function($childrenComplexity, $args)**<br> Used to restrict query complexity. The feature is disabled by default, read about [Security](../security.md#query-complexity-analysis) to use it.
84
82
description | `string` | Plain-text description of this field for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation)
85
83
deprecationReason | `string` | Text describing why this field is deprecated. When not empty - field will not be returned by introspection queries (unless forced)
86
84
87
-
# Field arguments
88
-
Every field on a GraphQL object type can have zero or more arguments, defined in **args** option of field definition.
89
-
Each argument is an array with following options:
85
+
## Field argument configuration options
90
86
91
87
Option | Type | Notes
92
88
------ | ---- | -----
@@ -149,7 +145,9 @@ $userType = new ObjectType([
149
145
]);
150
146
```
151
147
152
-
Same example for [inheritance style of type definitions](introduction.md#type-definition-styles) using [TypeRegistry](introduction.md#type-registry):
148
+
Same example for [inheritance style of type definitions](index.md#definition-styles)
149
+
using a type registry (see [lazy loading of types](../schema-definition.md#lazy-loading-of-types)):
0 commit comments