From 28f10ffc25de8239c506a274753bfc083672bd4f Mon Sep 17 00:00:00 2001 From: PatrikKozak Date: Fri, 8 Mar 2024 15:58:37 -0500 Subject: [PATCH] chore: removes schemaOutputFile prop in alpha --- docs/graphql/graphql-schema.mdx | 13 ------------- docs/graphql/overview.mdx | 1 - packages/payload/src/config/defaults.ts | 1 - packages/payload/src/config/schema.ts | 1 - packages/payload/src/config/types.ts | 1 - test/_community/config.ts | 4 ---- test/collections-graphql/config.ts | 1 - test/field-error-states/config.ts | 4 ---- test/graphql-schema-gen/config.ts | 3 --- 9 files changed, 29 deletions(-) diff --git a/docs/graphql/graphql-schema.mdx b/docs/graphql/graphql-schema.mdx index 743628821d..f3a62aa788 100644 --- a/docs/graphql/graphql-schema.mdx +++ b/docs/graphql/graphql-schema.mdx @@ -16,19 +16,6 @@ Run the following command in a Payload project to generate your project's GraphQ payload generate:graphQLSchema ``` -You can run this command whenever you need to regenerate your GraphQL schema and output it to a file, and then you can use the schema for writing your own GraphQL elsewhere in other projects. - -### Custom output file path - -```js -{ - // the remainder of your config - graphQL: { - schemaOutputFile: path.resolve(__dirname, './graphql/schema.graphql'), - }, -} -``` - ### Custom Field Schemas For `array`, `block`, `group` and named `tab` fields, you can generate top level reusable interfaces. The following group field config: diff --git a/docs/graphql/overview.mdx b/docs/graphql/overview.mdx index 2c68e4407b..1ef6561302 100644 --- a/docs/graphql/overview.mdx +++ b/docs/graphql/overview.mdx @@ -23,7 +23,6 @@ At the top of your Payload config you can define all the options to manage Graph | `maxComplexity` | A number used to set the maximum allowed complexity allowed by requests [More](/docs/graphql/overview#query-complexity-limits) | | `disablePlaygroundInProduction` | A boolean that if false will enable the GraphQL playground, defaults to true. [More](/docs/graphql/overview#graphql-playground) | | `disable` | A boolean that if true will disable the GraphQL entirely, defaults to false. | -| `schemaOutputFile` | A string for the file path used by the generate schema command. Defaults to `graphql.schema` next to `payload.config.ts` [More](/docs/graphql/graphql-schema) | ## Collections diff --git a/packages/payload/src/config/defaults.ts b/packages/payload/src/config/defaults.ts index 533aa031f1..ac5e460b68 100644 --- a/packages/payload/src/config/defaults.ts +++ b/packages/payload/src/config/defaults.ts @@ -28,7 +28,6 @@ export const defaults: Omit = { graphQL: { disablePlaygroundInProduction: true, maxComplexity: 1000, - schemaOutputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/schema.graphql`, }, hooks: {}, localization: false, diff --git a/packages/payload/src/config/schema.ts b/packages/payload/src/config/schema.ts index 8745e325be..123cc27fe1 100644 --- a/packages/payload/src/config/schema.ts +++ b/packages/payload/src/config/schema.ts @@ -111,7 +111,6 @@ export default joi.object({ maxComplexity: joi.number(), mutations: joi.function(), queries: joi.function(), - schemaOutputFile: joi.string(), }), hooks: joi.object().keys({ afterError: joi.func(), diff --git a/packages/payload/src/config/types.ts b/packages/payload/src/config/types.ts index 793e63ee04..e7b664cbd1 100644 --- a/packages/payload/src/config/types.ts +++ b/packages/payload/src/config/types.ts @@ -597,7 +597,6 @@ export type Config = { * @see https://payloadcms.com/docs/graphql/extending */ queries?: GraphQLExtension - schemaOutputFile?: string } /** * Tap into Payload-wide hooks. diff --git a/test/_community/config.ts b/test/_community/config.ts index f335261eef..455e71054d 100644 --- a/test/_community/config.ts +++ b/test/_community/config.ts @@ -14,10 +14,6 @@ export default buildConfigWithDefaults({ MenuGlobal, // ...add more globals here ], - graphQL: { - schemaOutputFile: './test/_community/schema.graphql', - }, - onInit: async (payload) => { await payload.create({ collection: 'users', diff --git a/test/collections-graphql/config.ts b/test/collections-graphql/config.ts index 4493292a3d..7075ec2607 100644 --- a/test/collections-graphql/config.ts +++ b/test/collections-graphql/config.ts @@ -358,7 +358,6 @@ export default buildConfigWithDefaults({ }, } }, - schemaOutputFile: path.resolve(dirname, 'schema.graphql'), }, onInit: async (payload) => { await payload.create({ diff --git a/test/field-error-states/config.ts b/test/field-error-states/config.ts index a211c49732..d404b67b0c 100644 --- a/test/field-error-states/config.ts +++ b/test/field-error-states/config.ts @@ -5,10 +5,6 @@ import Uploads from './collections/Upload/index.js' export default buildConfigWithDefaults({ collections: [ErrorFieldsCollection, Uploads], - graphQL: { - schemaOutputFile: './test/field-error-states/schema.graphql', - }, - onInit: async (payload) => { await payload.create({ collection: 'users', diff --git a/test/graphql-schema-gen/config.ts b/test/graphql-schema-gen/config.ts index 45836d33b3..fe49ebd52e 100644 --- a/test/graphql-schema-gen/config.ts +++ b/test/graphql-schema-gen/config.ts @@ -6,9 +6,6 @@ const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) export default buildConfigWithDefaults({ - graphQL: { - schemaOutputFile: path.resolve(dirname, 'schema.graphql'), - }, typescript: { outputFile: path.resolve(dirname, 'schema.ts'), },