Skip to content

Commit

Permalink
docs(www): update graphql starter docs for graphql_compose v2
Browse files Browse the repository at this point in the history
Fixes #596
  • Loading branch information
cruno91 authored Feb 20, 2024
1 parent 9f6ae58 commit 2b7f07f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 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
11 changes: 9 additions & 2 deletions www/content/tutorials/graphql/enable-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ group: Quick Start (GraphQL)
---

1. Visit `/admin/modules`.
2. Enable the following modules: **Next.js** and **Next.js GraphQL**.
2. Enable the following modules: **Next.js**, **Next.js GraphQL**, **GraphQL Compose: Edges**, **GraphQL Compose: Routes**.

## 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 2b7f07f

Please sign in to comment.