From a26d03190e16fed3f526821f91ce998c1c2d4e99 Mon Sep 17 00:00:00 2001 From: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:53:31 -0400 Subject: [PATCH] fix: re-exports graphql json types for external use (#6711) Fixes https://github.com/payloadcms/payload/issues/6683 Exports import `GraphQLJSON` and `GraphQLJSONObject` from `@payloadcms/graphql/types` ```ts import { GraphQLJSON, GraphQLJSONObject } from '@payloadcms/graphql/types' ``` --- packages/graphql/src/exports/types.ts | 1 + test/custom-graphql/config.ts | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 packages/graphql/src/exports/types.ts diff --git a/packages/graphql/src/exports/types.ts b/packages/graphql/src/exports/types.ts new file mode 100644 index 0000000000..454517d13f --- /dev/null +++ b/packages/graphql/src/exports/types.ts @@ -0,0 +1 @@ +export { GraphQLJSON, GraphQLJSONObject } from '../packages/graphql-type-json/index.js' diff --git a/test/custom-graphql/config.ts b/test/custom-graphql/config.ts index a75f56eb60..f0679fdb5d 100644 --- a/test/custom-graphql/config.ts +++ b/test/custom-graphql/config.ts @@ -1,3 +1,4 @@ +import { GraphQLJSON } from '@payloadcms/graphql/types' import { fileURLToPath } from 'node:url' import path from 'path' const filename = fileURLToPath(import.meta.url) @@ -35,6 +36,11 @@ export default buildConfigWithDefaults({ type: GraphQL.GraphQLString, resolve: resolveTransactionId, }, + foo: { + type: GraphQLJSON, + args: {}, + resolve: () => 'json test', + }, } }, mutations: (GraphQL) => {