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

docs(www): update graphql starter documentation to reflect graphql_co… #597

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.
Copy link
Collaborator

@JohnAlbin JohnAlbin Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Edge Query" is not an option unless "GraphQL Compose: Edges" is enabled, which the instructions do not indicate we need to do.

"Loading by Route" is not an option unless "GraphQL Compose: Routes" is enabled, which the instructions do not indicate we need to do.

So… we need to update the step above "2. Enable the following modules" to include those 2 modules. Are there other modules that should also be enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I forgot the module was split up a bit between beta and 2.x releases. I'll try to get a commit in for this this week if I can clear some time.

Copy link
Contributor Author

@cruno91 cruno91 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnAlbin it took a while for me to get back to it, but I've updated the list of modules for the GrpahQL example docs.

For the GraphQL example it doesn't look like there aren't any other modules which need to be manually enabled. Everything else should be enabled as dependencies of the current list.

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'
```
Loading