From 54647548ec94a7a9ccf03bc80d80113f3c490b10 Mon Sep 17 00:00:00 2001 From: Thomas Ladd Date: Wed, 8 Feb 2023 14:44:57 -0600 Subject: [PATCH] docs: add context to scope-auth plugin ordering relative to relay Fixes #708 --- packages/deno/packages/migration/mod.ts | 3 --- packages/deno/packages/plugin-add-graphql/mod.ts | 3 --- packages/deno/packages/plugin-scope-auth/README.md | 7 +++++-- packages/plugin-scope-auth/README.md | 7 +++++-- website/pages/docs/plugins/scope-auth.mdx | 7 +++++-- 5 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 packages/deno/packages/migration/mod.ts delete mode 100644 packages/deno/packages/plugin-add-graphql/mod.ts diff --git a/packages/deno/packages/migration/mod.ts b/packages/deno/packages/migration/mod.ts deleted file mode 100644 index e911f59d9..000000000 --- a/packages/deno/packages/migration/mod.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Default from './index.ts'; -export * from './index.ts'; -export default Default; diff --git a/packages/deno/packages/plugin-add-graphql/mod.ts b/packages/deno/packages/plugin-add-graphql/mod.ts deleted file mode 100644 index e911f59d9..000000000 --- a/packages/deno/packages/plugin-add-graphql/mod.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Default from './index.ts'; -export * from './index.ts'; -export default Default; diff --git a/packages/deno/packages/plugin-scope-auth/README.md b/packages/deno/packages/plugin-scope-auth/README.md index 0bc0af29e..7734cfe25 100644 --- a/packages/deno/packages/plugin-scope-auth/README.md +++ b/packages/deno/packages/plugin-scope-auth/README.md @@ -13,8 +13,11 @@ yarn add @pothos/plugin-scope-auth #### IMPORTANT -When using `scope-auth` with other plugins, make sure that the `scope-auth` plugin is listed first -to ensure that other plugins that wrap resolvers do not execute first. +When using `scope-auth` with other plugins, the `scope-auth` plugin should generally be listed first +to ensure that other plugins that wrap resolvers do not execute before the `scope-auth` logic. +However, exceptions do exist where it is desirable for a plugin to run before `scope-auth`. For +instance, putting the [relay plugin](https://pothos-graphql.dev/docs/plugins/relay) before the +`scope-auth` plugin results in the `authScopes` function correctly receiving parsed `globalID`s. ### Setup diff --git a/packages/plugin-scope-auth/README.md b/packages/plugin-scope-auth/README.md index 0bc0af29e..7734cfe25 100644 --- a/packages/plugin-scope-auth/README.md +++ b/packages/plugin-scope-auth/README.md @@ -13,8 +13,11 @@ yarn add @pothos/plugin-scope-auth #### IMPORTANT -When using `scope-auth` with other plugins, make sure that the `scope-auth` plugin is listed first -to ensure that other plugins that wrap resolvers do not execute first. +When using `scope-auth` with other plugins, the `scope-auth` plugin should generally be listed first +to ensure that other plugins that wrap resolvers do not execute before the `scope-auth` logic. +However, exceptions do exist where it is desirable for a plugin to run before `scope-auth`. For +instance, putting the [relay plugin](https://pothos-graphql.dev/docs/plugins/relay) before the +`scope-auth` plugin results in the `authScopes` function correctly receiving parsed `globalID`s. ### Setup diff --git a/website/pages/docs/plugins/scope-auth.mdx b/website/pages/docs/plugins/scope-auth.mdx index c57f2ba1d..e25e9ee06 100644 --- a/website/pages/docs/plugins/scope-auth.mdx +++ b/website/pages/docs/plugins/scope-auth.mdx @@ -27,8 +27,11 @@ yarn add @pothos/plugin-scope-auth #### IMPORTANT -When using `scope-auth` with other plugins, make sure that the `scope-auth` plugin is listed first -to ensure that other plugins that wrap resolvers do not execute first. +When using `scope-auth` with other plugins, the `scope-auth` plugin should generally be listed first +to ensure that other plugins that wrap resolvers do not execute before the `scope-auth` logic. +However, exceptions do exist where it is desirable for a plugin to run before `scope-auth`. For +instance, putting the [relay plugin](https://pothos-graphql.dev/docs/plugins/relay) before the +`scope-auth` plugin results in the `authScopes` function correctly receiving parsed `globalID`s. ### Setup