From 2b7f07f86f997eabdb99e6e700f1cbd4b599f648 Mon Sep 17 00:00:00 2001 From: Chris Runo Date: Tue, 20 Feb 2024 13:41:33 -0500 Subject: [PATCH] docs(www): update graphql starter docs for graphql_compose v2 Fixes #596 --- www/content/tutorials/graphql/apply-patches.mdx | 4 ++-- www/content/tutorials/graphql/enable-modules.mdx | 11 +++++++++-- www/content/tutorials/graphql/install-drupal.mdx | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/www/content/tutorials/graphql/apply-patches.mdx b/www/content/tutorials/graphql/apply-patches.mdx index cf685951..43ad17a8 100644 --- a/www/content/tutorials/graphql/apply-patches.mdx +++ b/www/content/tutorials/graphql/apply-patches.mdx @@ -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 diff --git a/www/content/tutorials/graphql/enable-modules.mdx b/www/content/tutorials/graphql/enable-modules.mdx index b5d04a4f..1997a8c0 100644 --- a/www/content/tutorials/graphql/enable-modules.mdx +++ b/www/content/tutorials/graphql/enable-modules.mdx @@ -6,7 +6,14 @@ 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 @@ -14,7 +21,7 @@ If you visit `/admin/config/graphql/servers/manage/graphql_compose_server/explor 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 { diff --git a/www/content/tutorials/graphql/install-drupal.mdx b/www/content/tutorials/graphql/install-drupal.mdx index d5103b01..1db1d176 100644 --- a/www/content/tutorials/graphql/install-drupal.mdx +++ b/www/content/tutorials/graphql/install-drupal.mdx @@ -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' ```