Skip to content

GraphQL Introspection can't be disabled #4569

@JulianAtTheFrontend

Description

@JulianAtTheFrontend

Link to reproduction

No response

Describe the Bug

Currently there is no way to disable GraphQL introspection and I'd rather call it a bug than a feature request as it exposes the complete schema without any restrictions. Ideally I'd even like to apply an access rule e.g. to still fetch it for development of a headless frontend.

To Reproduce

Just enable graphQL and try to retreive the schema with @graphql-codegen/cli

// codegen.ts
// https://the-guild.dev/graphql/codegen/plugins/other/schema-ast
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
  overwrite: true,
  generates: {
    './src/types/payloadSchema.graphql': {
      schema: 'https://<PAYLOAD_URL>/api/graphql',
      plugins: ['schema-ast'],
    },
  }
};

export default config;

Payload Version

2.0.11

Adapters and Plugins

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions