API Reference for NextDrupal client.
diff --git a/www/content/docs/typescript.mdx b/www/content/docs/typescript.mdx
index 12f29fe7..ddd1c612 100644
--- a/www/content/docs/typescript.mdx
+++ b/www/content/docs/typescript.mdx
@@ -7,6 +7,8 @@ Every helper method for the `NextDrupal` client has full TypeScript support.
The `next-drupal` module ships with some default basic types you can use.
+For a full list of all types, consult the [API Reference](/api/modules).
+
---
## Built-in Types
diff --git a/www/content/docs/updating-resources.mdx b/www/content/docs/updating-resources.mdx
index 2032e232..6b32f6be 100644
--- a/www/content/docs/updating-resources.mdx
+++ b/www/content/docs/updating-resources.mdx
@@ -3,12 +3,6 @@ title: Updating Resources (PATCH)
excerpt: How to update JSON:API resources using NextDrupal client.
---
-
-
-The `updateResource` helper is available in `next-drupal ^1.4.0`.
-
-
-
If you're working with JSON:API, be mindful to select the option:
@@ -65,7 +59,7 @@ const article = await drupal.updateResource(
)
```
-See the API reference for [updateResource](/docs/reference/updateresource).
+See the API reference for [updateResource](/api/classes/NextDrupal#updateresource).
---
diff --git a/www/content/guides/umami-demo.mdx b/www/content/guides/umami-demo.mdx
index f7b8044c..ce4cdb72 100644
--- a/www/content/guides/umami-demo.mdx
+++ b/www/content/guides/umami-demo.mdx
@@ -17,7 +17,7 @@ composer create-project drupal/recommended-project umami
"extra": {
"patches": {
"drupal/decoupled_router": {
- "Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-10-22/decoupled_router-3111456-resolve-langcode-issue-78--external-redirects.patch"
+ "Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-08-05/decouple_router-3111456-resolve-language-issue-63--get-translation-re-rolled-and-good-redirect.patch"
}
},
}
@@ -26,7 +26,7 @@ composer create-project drupal/recommended-project umami
3. Add dependencies
```bash
-composer require drupal/next drupal/jsonapi_menu_items drupal/jsonapi_views drupal/jsonapi_resources
+composer require drupal/next drupal/jsonapi_menu_items drupal/jsonapi_views drupal/jsonapi_resources cweagans/composer-patches
```
4. Install Drupal. Make sure you select **Demo: Umami Food Magazine (Experimental)** as the installation profile.
@@ -75,6 +75,8 @@ yarn dev
5. Visit `http://localhost:3000` to see the Next.js site.
+
diff --git a/www/content/tutorials/draft-mode/create-oauth-client.mdx b/www/content/tutorials/draft-mode/create-oauth-client.mdx
index e9b983ba..ebd1165f 100644
--- a/www/content/tutorials/draft-mode/create-oauth-client.mdx
+++ b/www/content/tutorials/draft-mode/create-oauth-client.mdx
@@ -81,7 +81,7 @@ openssl rsa -in private.key -pubout > public.key
---
-## 5. Create Scopes
+## 5. Create Scope
1. Visit _/admin/config/people/simple_oauth/oauth2_scope/dynamic/add_
2. Fill in the following values:
@@ -102,7 +102,7 @@ openssl rsa -in private.key -pubout > public.key
2. Fill in the following values:
- **Label**: `Next.js site`
-- **Client ID**: `nextjs_site` (or generate a UUID is preferred)
+- **Client ID**: `nextjs_site` (or generate a UUID if preferred)
- **Secret**: `Your secret`
- **Grant Types**: `Client Credentials`
- **Scopes**: `nextjs_site`
@@ -114,7 +114,7 @@ _Important: note the client id (uuid) and the secret. These are going to be used
---
-## 6. Connect Drupal
+## 7. Connect Drupal
To connect the Next.js project to Drupal, we use [environment variables](https://nextjs.org/docs/basic-features/environment-variables).
@@ -128,7 +128,7 @@ DRUPAL_CLIENT_SECRET=
---
-## 7. Update NextDrupal client.
+## 8. Update NextDrupal client.
Update the `NextDrupal` client to use the **Bearer** authentication header.
diff --git a/www/content/tutorials/graphql/apply-patches.mdx b/www/content/tutorials/graphql/apply-patches.mdx
index e75f0d00..5318acea 100644
--- a/www/content/tutorials/graphql/apply-patches.mdx
+++ b/www/content/tutorials/graphql/apply-patches.mdx
@@ -21,7 +21,7 @@ At the time of this writing, a patch is required in order to use multilingual fe
// highlight-start
"patches": {
"drupal/decoupled_router": {
- "Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-10-22/decoupled_router-3111456-resolve-langcode-issue-78--external-redirects.patch"
+ "Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-08-05/decouple_router-3111456-resolve-language-issue-63--get-translation-re-rolled-and-good-redirect.patch"
}
},
// highlight-end
diff --git a/www/content/tutorials/graphql/configure-authentication.mdx b/www/content/tutorials/graphql/configure-authentication.mdx
index 5bca6e61..f07e2868 100644
--- a/www/content/tutorials/graphql/configure-authentication.mdx
+++ b/www/content/tutorials/graphql/configure-authentication.mdx
@@ -54,18 +54,33 @@ openssl rsa -in private.key -pubout > public.key
---
-## 5. Create Consumer
+## 5. Create Scope
+
+1. Visit _/admin/config/people/simple_oauth/oauth2_scope/dynamic/add_
+2. Fill in the following values:
+
+- **Machine-readable Name**: `nextjs_site`
+- **Description**: `Next.js Site`
+- **Grant Types**: `Client Credentials`
+- **Granularity**: `Role`
+- **Role**: `Next.js Site`
+
+3. Click **Save**
+
+---
+
+## 6. Create Consumer
1. Visit _/admin/config/services/consumer/add_
2. Fill in the following values:
- **Label**: `Next.js site`
-- **Client ID**: `nextjs_site`
-- **User**: `Select the user we created`
+- **Client ID**: `nextjs_site` (or generate a UUID if preferred)
- **Secret**: `Your secret`
-- **Grant Types**: `Select 'Client Credentials'`
-- **Scopes**: `Select the role we created`
+- **Grant Types**: `Client Credentials`
+- **Scopes**: `nextjs_site`
+- **User**: `Select the user we created`
3. Click **Save**
-_Important: note the client id and the secret. These are going to be used as environment variables for the Next.js site._
+_Important: note the client id (uuid) and the secret. These are going to be used as environment variables for the Next.js site._
diff --git a/www/content/tutorials/graphql/enable-modules.mdx b/www/content/tutorials/graphql/enable-modules.mdx
index 1997a8c0..64eb8d30 100644
--- a/www/content/tutorials/graphql/enable-modules.mdx
+++ b/www/content/tutorials/graphql/enable-modules.mdx
@@ -6,14 +6,15 @@ group: Quick Start (GraphQL)
---
1. Visit `/admin/modules`.
-2. Enable the following modules: **Next.js**, **Next.js GraphQL**, **GraphQL Compose: Edges**, **GraphQL Compose: Routes**.
+2. Enable the following modules: **Next.js**, **Next.js GraphQL**, **GraphQL Compose: Edges**, **GraphQL Compose: Routes**, **GraphQL Compose: Users**.
## Configure GraphQL Compose
1. Visit `/admin/config/graphql_compose`.
-2. Enable "GraphQL", "Single Query", "Edge Query", & "Loading by Route" for the Article content type.
+2. Under the Content tab, 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.
+5. Under the Users tab, do the same for the user entity.
## Try GraphQL
diff --git a/www/content/tutorials/quick-start/apply-patches.mdx b/www/content/tutorials/quick-start/apply-patches.mdx
index 727f2f92..695cdf86 100644
--- a/www/content/tutorials/quick-start/apply-patches.mdx
+++ b/www/content/tutorials/quick-start/apply-patches.mdx
@@ -21,7 +21,7 @@ At the time of this writing, a patch is required in order to use multilingual fe
// highlight-start
"patches": {
"drupal/decoupled_router": {
- "Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-10-22/decoupled_router-3111456-resolve-langcode-issue-78--external-redirects.patch"
+ "Unable to resolve path on node in other language than default": "https://www.drupal.org/files/issues/2024-08-05/decouple_router-3111456-resolve-language-issue-63--get-translation-re-rolled-and-good-redirect.patch"
}
},
// highlight-end
diff --git a/www/next-env.d.ts b/www/next-env.d.ts
index 4f11a03d..a4a7b3f5 100644
--- a/www/next-env.d.ts
+++ b/www/next-env.d.ts
@@ -2,4 +2,4 @@
///
// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
+// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
diff --git a/www/next.config.js b/www/next.config.js
index 3d9e3363..5c102130 100644
--- a/www/next.config.js
+++ b/www/next.config.js
@@ -107,6 +107,19 @@ module.exports = {
destination: "/docs/api/:path*",
permanent: true,
},
+ {
+ source: "/api/:path*.html",
+ destination: "/api/:path*",
+ permanent: true,
+ },
+ ]
+ },
+ async rewrites() {
+ return [
+ {
+ source: "/api/:slug*",
+ destination: "/api/:slug*.html", // Matched parameters can be used in the destination
+ },
]
},
}