Skip to content

Commit

Permalink
docs(www): update graphql starter documentation to reflect graphql_co…
Browse files Browse the repository at this point in the history
…mpose 2.0.0 and graphql 4.6.0
  • Loading branch information
cruno91 committed Nov 17, 2023
1 parent 1be6184 commit fb0d968
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions www/content/tutorials/graphql/apply-patches.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ At the time of this writing, there are two patches we need to wire everything to
// highlight-start
"patches": {
"drupal/subrequests": {
"Get same results on different request": "https://www.drupal.org/files/issues/2019-07-18/change_request_type-63049395-09.patch"
"#3049395-47 - Page Cache causes different subrequests to return the same responses": "https://www.drupal.org/files/issues/2022-12-06/subrequests-3049395-chnage-request-type-47.patch"
},
"drupal/decoupled_router": {
"Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2022-11-30/decouple_router-3111456-resolve-language-issue-58.patch"
"#3111456-59 - Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2022-12-01/decouple_router-3111456-resolve-language-issue-58--get-translation.patch"
}
},
// highlight-end
Expand Down
9 changes: 8 additions & 1 deletion www/content/tutorials/graphql/enable-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ group: Quick Start (GraphQL)
1. Visit `/admin/modules`.
2. Enable the following modules: **Next.js** and **Next.js GraphQL**.

## Configure GraphQL Compose

1. Visit `/admin/config/graphql_compose`.
2. Enable "GraphQL", "Single Query", "Edge Query", & "Loading by Route" for the Article content type.
3. Enable all of the fields for the Article content type.
4. Do the same for the Basic page content type.

## Try GraphQL

If you visit `/admin/config/graphql/servers/manage/graphql_compose_server/explorer` on your site, you should see an example server created for you.

You can start testing GraphQL queries. Let's make our first request to fetch the first 5 articles.

Copy and paste the following in the query textbox and click run.
Copy and paste the following in the query text input and click the Execute Query (▶) button.

```graphql
query Articles {
Expand Down
2 changes: 1 addition & 1 deletion www/content/tutorials/graphql/install-drupal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ composer require drupal/next
Run the following command to install GraphQL and GraphQL Compose modules:

```sh
composer require 'drupal/graphql:^4.4' 'drupal/graphql_compose:^1.0@beta'
composer require 'drupal/graphql:^4.6' 'drupal/graphql_compose:^2.0'
```

0 comments on commit fb0d968

Please sign in to comment.