Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC GraphQL src must always be an array. #10213

Merged
merged 3 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ relative to the project root.
SilverStripe\GraphQL\Schema\Schema:
schemas:
default:
src: app/_graphql
unclecheese marked this conversation as resolved.
Show resolved Hide resolved
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:
Expand All @@ -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'
unclecheese marked this conversation as resolved.
Show resolved Hide resolved
```

[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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ query {
nodes {
name
}
}
}
}
```

Expand Down