From 305a6d7bebf9a28ab17bd6f8dd11403d9d918e85 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Mon, 24 Jan 2022 12:47:31 +1300 Subject: [PATCH 1/3] DOC GraphQL src must always be an array. --- .../02_configuring_your_schema.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md b/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md index 49980cb8118..cf632cb93d5 100644 --- a/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md +++ b/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md @@ -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 an exposed folder e.g.: 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. From 841b0fe6ca2aa9111b2a20ae86517660dfc07df9 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Mon, 24 Jan 2022 14:15:14 +1300 Subject: [PATCH 2/3] DOC Tweak the graphql module syntax --- .../01_getting_started/02_configuring_your_schema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md b/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md index cf632cb93d5..f7e9828ee88 100644 --- a/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md +++ b/docs/en/02_Developer_Guides/19_GraphQL/01_getting_started/02_configuring_your_schema.md @@ -98,8 +98,8 @@ SilverStripe\GraphQL\Schema\Schema: src: - app/_graphql - module/_graphql - # The next line would map to an exposed folder e.g.: vendor/somevendor/somemodule/_graphql - - somevendor/somemodule: _graphql + # The next line would map to `vendor/somevendor/somemodule/_graphql` + - 'somevendor/somemodule: _graphql' ``` From c314e33e4a6cab9fb18dd0aba5ecf8aa6d05a819 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Mon, 24 Jan 2022 15:59:27 +1300 Subject: [PATCH 3/3] DOC Fix minor linting issue in example --- .../03_working_with_generic_types/05_adding_pagination.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/19_GraphQL/03_working_with_generic_types/05_adding_pagination.md b/docs/en/02_Developer_Guides/19_GraphQL/03_working_with_generic_types/05_adding_pagination.md index fae92d2b5c7..665c621207b 100644 --- a/docs/en/02_Developer_Guides/19_GraphQL/03_working_with_generic_types/05_adding_pagination.md +++ b/docs/en/02_Developer_Guides/19_GraphQL/03_working_with_generic_types/05_adding_pagination.md @@ -102,7 +102,7 @@ query { nodes { name } - } + } } ```