Skip to content

Commit ccd11f6

Browse files
committed
Fix docs: reintroduce index pages, fix all references
1 parent 35d2977 commit ccd11f6

16 files changed

+30
-33
lines changed

docs/class-reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ const INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
422422
# GraphQL\Type\SchemaConfig
423423
Schema configuration class.
424424
Could be passed directly to schema constructor. List of options accepted by **create** method is
425-
[described in docs](type-definitions/schema-definition.md#configuration-options).
425+
described in the [schema definition docs](schema-definition.md#configuration-options).
426426

427427
Usage example:
428428

@@ -565,7 +565,7 @@ function getTypeLoader()
565565
function setTypeLoader(callable $typeLoader)
566566
```
567567
# GraphQL\Type\Schema
568-
Schema Definition (see [related docs](type-definitions/schema-definition.md))
568+
Schema Definition (see [schema definition docs](schema-definition.md))
569569

570570
A Schema is created by supplying the root types of each type of operation:
571571
query, mutation (optional) and subscription (optional). A schema definition is
@@ -763,7 +763,7 @@ function assertValid()
763763
function validate()
764764
```
765765
# GraphQL\Language\Parser
766-
Parses string containing GraphQL query or [type definition](type-definitions/schema-definition-language.md) to Abstract Syntax Tree.
766+
Parses string containing GraphQL query language or [schema definition language](schema-definition-language.md) to Abstract Syntax Tree.
767767

768768
Those magic functions allow partial parsing:
769769

docs/complementary-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Integrations
22

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/)).
44
* [Relay Library for graphql-php](https://github.com/ivome/graphql-relay-php) – Helps construct Relay related schema definitions.
55
* [Lighthouse](https://github.com/nuwave/lighthouse) – Laravel based, uses Schema Definition Language
66
* [Laravel GraphQL](https://github.com/rebing/graphql-laravel) - Laravel wrapper for Facebook's GraphQL

docs/data-fetching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plain files or in-memory data structures.
44

55
In order to convert the GraphQL query to PHP array, **graphql-php** traverses query fields (using depth-first algorithm) and
66
runs special **resolve** function on each field. This **resolve** function is provided by you as a part of
7-
[field definition](type-definitions/object-types.md#field-configuration-options) or [query execution call](executing-queries.md#overview).
7+
[field definition](type-definitions/object-types.md#field-configuration-options) or [query execution call](executing-queries.md).
88

99
Result returned by **resolve** function is directly included in the response (for scalars and enums)
1010
or passed down to nested fields (for objects).

docs/executing-queries.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Description of **executeQuery** method arguments:
3737

3838
Argument | Type | Notes
3939
------------ | -------- | -----
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)
4141
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.
4242
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.
4343
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:
9595

9696
Argument | Type | Notes
9797
------------ | -------- | -----
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)
9999
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.
100100
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.
101101
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
105105
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).
106106
errorFormatter | `callable` | Custom error formatter. See [error handling docs](error-handling.md#custom-error-handling-and-formatting).
107107
errorsHandler | `callable` | Custom errors handler. See [error handling docs](error-handling.md#custom-error-handling-and-formatting).
108-
promiseAdapter | [`PromiseAdapter`](class-reference.md#graphqlexecutorpromisepromiseadapter) | Required for [Async PHP](data-fetching/#async-php) only.
108+
promiseAdapter | [`PromiseAdapter`](class-reference.md#graphqlexecutorpromisepromiseadapter) | Required for [Async PHP](data-fetching.md#async-php) only.
109109

110110
**Server config instance**
111111

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ $queryType = new ObjectType([
6262

6363
```
6464

65-
(Note: type definition can be expressed in [different styles](type-definitions/introduction.md#definition-styles))
65+
(Note: type definition can be expressed in [different styles](type-definitions/index.md#definition-styles))
6666

6767
The interesting piece here is **resolve** option of field definition. It is responsible for returning
6868
a value of our field. Values of **scalar** fields will be directly included in response while values of

docs/about.md renamed to docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ are used. Instead, it provides tools for creating rich API for your existing app
2828

2929
Library features include:
3030

31-
- Primitives to express your app as a [Type System](type-definitions/introduction.md)
32-
- Validation and introspection of this Type System (for compatibility with tools like [GraphiQL](complementary-tools.md#tools))
31+
- Primitives to express your app as a [Type System](type-definitions/index.md)
32+
- Validation and introspection of this Type System (for compatibility with [tools like GraphiQL](complementary-tools.md#general-graphql-tools))
3333
- Parsing, validating and [executing GraphQL queries](executing-queries.md) against this Type System
3434
- Rich [error reporting](error-handling.md), including query validation and execution errors
3535
- Optional tools for [parsing schema definition language](schema-definition-language.md)

docs/type-definitions/enums.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $episodeEnum = new EnumType([
3030
```
3131

3232
This example uses an **inline** style for Enum Type definition, but you can also use
33-
[inheritance or schema definition language](introduction.md#definition-styles).
33+
[inheritance or schema definition language](index.md#definition-styles).
3434

3535
# Configuration options
3636
Enum Type constructor accepts an array with following options:
File renamed without changes.

docs/type-definitions/interfaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $character = new InterfaceType([
3333
]);
3434
```
3535
This example uses **inline** style for Interface definition, but you can also use
36-
[inheritance or schema definition language](introduction.md#definition-styles).
36+
[inheritance or schema definition language](index.md#definition-styles).
3737

3838
# Configuration options
3939
The constructor of InterfaceType accepts an array. Below is a full list of allowed options:

docs/type-definitions/object-types.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Conceptually Object Type is a collection of Fields. Each field, in turn,
55
has its own type which allows building complex hierarchies.
66

77
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:
99

1010
```php
1111
<?php
@@ -57,36 +57,32 @@ $blogStory = new ObjectType([
5757
]);
5858
```
5959
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).
6161

6262
# Configuration options
63-
Object type constructor expects configuration array. Below is a full list of available options:
6463

6564
Option | Type | Notes
6665
------------ | -------- | -----
6766
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.
6968
description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation)
7069
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.
7170
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).
7271
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.
7372

74-
# Field configuration options
75-
Below is a full list of available field configuration options:
73+
## Field configuration options
7674

7775
Option | Type | Notes
7876
------ | ---- | -----
7977
name | `string` | **Required.** Name of the field. When not set - inferred from **fields** array key (read about [shorthand field definition](#shorthand-field-definitions) below)
8078
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).
8280
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
8381
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.
8482
description | `string` | Plain-text description of this field for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation)
8583
deprecationReason | `string` | Text describing why this field is deprecated. When not empty - field will not be returned by introspection queries (unless forced)
8684

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
9086

9187
Option | Type | Notes
9288
------ | ---- | -----
@@ -149,7 +145,9 @@ $userType = new ObjectType([
149145
]);
150146
```
151147

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)):
150+
153151
```php
154152
<?php
155153
namespace MyApp;

0 commit comments

Comments
 (0)