diff --git a/.changeset/@graphql-mesh_serve-cli-6553-dependencies.md b/.changeset/@graphql-mesh_serve-cli-6553-dependencies.md new file mode 100644 index 0000000000000..781b7464d85c5 --- /dev/null +++ b/.changeset/@graphql-mesh_serve-cli-6553-dependencies.md @@ -0,0 +1,7 @@ +--- +"@graphql-mesh/serve-cli": patch +--- +dependencies updates: + - Added dependency [`@graphql-mesh/cross-helpers@^0.4.1` ↗︎](https://www.npmjs.com/package/@graphql-mesh/cross-helpers/v/0.4.1) (to `dependencies`) + - Added dependency [`@graphql-mesh/runtime@^0.97.5` ↗︎](https://www.npmjs.com/package/@graphql-mesh/runtime/v/0.97.5) (to `dependencies`) + - Added dependency [`@graphql-mesh/utils@^0.96.4` ↗︎](https://www.npmjs.com/package/@graphql-mesh/utils/v/0.96.4) (to `dependencies`) diff --git a/.changeset/tall-experts-divide.md b/.changeset/tall-experts-divide.md new file mode 100644 index 0000000000000..3602f0ceaf212 --- /dev/null +++ b/.changeset/tall-experts-divide.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/runtime": patch +"@graphql-mesh/types": patch +--- + +Correct additional envelop plugins docs diff --git a/packages/runtime/src/get-mesh.ts b/packages/runtime/src/get-mesh.ts index 2d02aff81f20a..0ee3d0c3cf3c8 100644 --- a/packages/runtime/src/get-mesh.ts +++ b/packages/runtime/src/get-mesh.ts @@ -162,7 +162,7 @@ export async function getMesh(options: GetMeshOptions): Promise { setFetchFn(fetchFn); }, }, - ...(additionalEnvelopPlugins as MeshPlugin[]), + ...additionalEnvelopPlugins, ]; const wrappedFetchFn: MeshFetch = wrapFetchWithPlugins(initialPluginList); await Promise.allSettled( diff --git a/packages/runtime/src/types.ts b/packages/runtime/src/types.ts index 3eefc624fd1c6..330081455a213 100644 --- a/packages/runtime/src/types.ts +++ b/packages/runtime/src/types.ts @@ -1,5 +1,5 @@ import { DocumentNode, ExecutionResult } from 'graphql'; -import { envelop } from '@envelop/core'; +import { Plugin } from '@envelop/core'; import { GraphQLOperation, KeyValueCache, @@ -24,7 +24,7 @@ export type GetMeshOptions = { pubsub?: MeshPubSub; merger: MeshMerger; logger?: Logger; - additionalEnvelopPlugins?: Parameters[0]['plugins']; + additionalEnvelopPlugins?: Plugin[]; documents?: Source[]; fetchFn?: MeshFetch; }; diff --git a/packages/types/src/config-schema.json b/packages/types/src/config-schema.json index b2652b75c54c1..dc898373f8df4 100644 --- a/packages/types/src/config-schema.json +++ b/packages/types/src/config-schema.json @@ -4291,7 +4291,7 @@ }, "additionalEnvelopPlugins": { "type": "string", - "description": "You can provide Envelop plugins" + "description": "Path to a JavaScript file with a default export of Envelop plugins" }, "plugins": { "type": "array", diff --git a/packages/types/src/config.ts b/packages/types/src/config.ts index 9974791cd0eed..d2af537182a7d 100644 --- a/packages/types/src/config.ts +++ b/packages/types/src/config.ts @@ -63,7 +63,7 @@ export interface Config { */ skipSSLValidation?: boolean; /** - * You can provide Envelop plugins + * Path to a JavaScript file with a default export of Envelop plugins */ additionalEnvelopPlugins?: string; plugins?: Plugin[]; diff --git a/website/src/pages/docs/guides/error-masking.mdx b/website/src/pages/docs/guides/error-masking.mdx index fd76efabe7caa..515e0fb7aabde 100644 --- a/website/src/pages/docs/guides/error-masking.mdx +++ b/website/src/pages/docs/guides/error-masking.mdx @@ -51,7 +51,8 @@ Envelop allows you to provide your error formatting function as follows: ```ts filename="envelopPlugins.ts" import { GraphQLError } from 'graphql' -import { PluginOrDisabledPlugin, useMaskedErrors } from '@envelop/core' +import { Plugin, useMaskedErrors } from '@envelop/core' +import { MeshPlugin } from '@graphql-mesh/types' export const formatError: FormatErrorHandler = err => { if (err.originalError && err.originalError instanceof GraphQLError === false) { @@ -61,7 +62,7 @@ export const formatError: FormatErrorHandler = err => { return err } -const plugins: PluginOrDisabledPlugin = [ +const plugins: MeshPlugin[] = [ useMaskedErrors({ errorMessage: 'Something went wrong.', formatError diff --git a/website/src/pages/docs/plugins/plugins-introduction.mdx b/website/src/pages/docs/plugins/plugins-introduction.mdx index 52351c570089d..5b7ce254bbd54 100644 --- a/website/src/pages/docs/plugins/plugins-introduction.mdx +++ b/website/src/pages/docs/plugins/plugins-introduction.mdx @@ -73,7 +73,7 @@ import { useDepthLimit } from '@envelop/depth-limit' import { useSentry } from '@envelop/sentry' import { MeshPlugin } from '@graphql-mesh/types' -const plugins: MeshPlugin = [ +const plugins: MeshPlugin[] = [ useDepthLimit({ maxDepth: 10 }),