Skip to content

feat(graphql): allow to enable/disable the introspection query #1792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ api_platform:
# Enabled by default with installed webonyx/graphql-php and Twig.
enabled: false

introspection:
# Enabled by default with installed webonyx/graphql-php.
enabled: true

# The nesting separator used in the filter names.
nesting_separator: _

Expand Down
14 changes: 14 additions & 0 deletions core/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ api_platform:
# ...
```

## Disabling the Introspection Query

For security reason, the introspection query should be disabled to not expose the GraphQL schema.

If you need to disable it, it can be done in the configuration:

```yaml
# api/config/packages/api_platform.yaml
api_platform:
graphql:
introspection: false
# ...
```

## Request with `application/graphql` Content-Type

If you wish to send a [POST request using the `application/graphql` Content-Type](https://graphql.org/learn/serving-over-http/#post-request),
Expand Down