mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-18 04:02:30 +03:00
Enable headers editor in GraphiQL by default
This commit is contained in:
parent
ea10c33c0a
commit
9f8fd4346b
|
@ -193,14 +193,14 @@ Default: ``None``
|
||||||
|
|
||||||
GraphiQL starting from version 1.0.0 allows setting custom headers in similar fashion to query variables.
|
GraphiQL starting from version 1.0.0 allows setting custom headers in similar fashion to query variables.
|
||||||
|
|
||||||
Set to ``True`` to enable GraphiQL headers editor tab.
|
Set to ``False`` if you want to disable GraphiQL headers editor tab for some reason.
|
||||||
|
|
||||||
This setting is passed to ``headerEditorEnabled`` GraphiQL options, for details refer to GraphiQLDocs_.
|
This setting is passed to ``headerEditorEnabled`` GraphiQL options, for details refer to GraphiQLDocs_.
|
||||||
|
|
||||||
.. _GraphiQLDocs: https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
|
.. _GraphiQLDocs: https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
|
||||||
|
|
||||||
|
|
||||||
Default: ``False``
|
Default: ``True``
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ DEFAULTS = {
|
||||||
"DJANGO_CHOICE_FIELD_ENUM_CUSTOM_NAME": None,
|
"DJANGO_CHOICE_FIELD_ENUM_CUSTOM_NAME": None,
|
||||||
# Use a separate path for handling subscriptions.
|
# Use a separate path for handling subscriptions.
|
||||||
"SUBSCRIPTION_PATH": None,
|
"SUBSCRIPTION_PATH": None,
|
||||||
# Set to True to enable GraphiQL headers editor tab
|
# By default GraphiQL headers editor tab is enabled, set to False to hide it
|
||||||
# This sets headerEditorEnabled GraphiQL option, for details go to
|
# This sets headerEditorEnabled GraphiQL option, for details go to
|
||||||
# https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
|
# https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
|
||||||
"GRAPHIQL_HEADER_EDITOR_ENABLED": False,
|
"GRAPHIQL_HEADER_EDITOR_ENABLED": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
|
|
@ -175,7 +175,7 @@
|
||||||
onEditQuery: onEditQuery,
|
onEditQuery: onEditQuery,
|
||||||
onEditVariables: onEditVariables,
|
onEditVariables: onEditVariables,
|
||||||
onEditOperationName: onEditOperationName,
|
onEditOperationName: onEditOperationName,
|
||||||
headerEditorEnabled: GRAPHENE_SETTINGS.graphiqlHeaderEditorEnabled || false,
|
headerEditorEnabled: GRAPHENE_SETTINGS.graphiqlHeaderEditorEnabled || true,
|
||||||
query: parameters.query,
|
query: parameters.query,
|
||||||
};
|
};
|
||||||
if (parameters.variables) {
|
if (parameters.variables) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user