mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-28 20:29:15 +02:00
DOC GraphQL src must always be an array. (#10213)
* DOC GraphQL src must always be an array. * DOC Tweak the graphql module syntax * DOC Fix minor linting issue in example
This commit is contained in:
parent
4044573ae7
commit
6e1bc807e5
@ -78,14 +78,18 @@ relative to the project root.
|
||||
SilverStripe\GraphQL\Schema\Schema:
|
||||
schemas:
|
||||
default:
|
||||
src: app/_graphql
|
||||
src:
|
||||
- app/_graphql
|
||||
```
|
||||
|
||||
Your `src` must be an array. This allows further source files to be merged into your schema.
|
||||
This feature can be use to extend the schema of third party modules.
|
||||
|
||||
[info]
|
||||
It is recommended that you define your sources as an array so that further source files are merged.
|
||||
Otherwise, another config file could completely override part of your schema definition.
|
||||
Your directory can also be a module reference, e.g. `somevendor/somemodule: _graphql`
|
||||
[/info]
|
||||
|
||||
|
||||
**app/_config/graphql.yml**
|
||||
```yml
|
||||
SilverStripe\GraphQL\Schema\Schema:
|
||||
@ -94,11 +98,11 @@ SilverStripe\GraphQL\Schema\Schema:
|
||||
src:
|
||||
- app/_graphql
|
||||
- module/_graphql
|
||||
# The next line would map to `vendor/somevendor/somemodule/_graphql`
|
||||
- 'somevendor/somemodule: _graphql'
|
||||
```
|
||||
|
||||
[info]
|
||||
Your directory can also be a module reference, e.g. `somevendor/somemodule: _graphql`
|
||||
[/info]
|
||||
|
||||
|
||||
Now, in our `app/_graphql` file, we can create YAML file definitions.
|
||||
|
||||
|
@ -102,7 +102,7 @@ query {
|
||||
nodes {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user