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' ```
This commit is contained in:
1
packages/graphql/src/exports/types.ts
Normal file
1
packages/graphql/src/exports/types.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { GraphQLJSON, GraphQLJSONObject } from '../packages/graphql-type-json/index.js'
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { GraphQLJSON } from '@payloadcms/graphql/types'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
@@ -35,6 +36,11 @@ export default buildConfigWithDefaults({
|
|||||||
type: GraphQL.GraphQLString,
|
type: GraphQL.GraphQLString,
|
||||||
resolve: resolveTransactionId,
|
resolve: resolveTransactionId,
|
||||||
},
|
},
|
||||||
|
foo: {
|
||||||
|
type: GraphQLJSON,
|
||||||
|
args: {},
|
||||||
|
resolve: () => 'json test',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mutations: (GraphQL) => {
|
mutations: (GraphQL) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user