Enable headers editor in GraphiQL by default

This commit is contained in:
radoslaw.kowalski 2020-08-06 21:36:07 +02:00
parent ea10c33c0a
commit 9f8fd4346b
3 changed files with 5 additions and 5 deletions

View File

@ -193,14 +193,14 @@ Default: ``None``
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_.
.. _GraphiQLDocs: https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
Default: ``False``
Default: ``True``
.. code:: python

View File

@ -41,10 +41,10 @@ DEFAULTS = {
"DJANGO_CHOICE_FIELD_ENUM_CUSTOM_NAME": None,
# Use a separate path for handling subscriptions.
"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
# https://github.com/graphql/graphiql/tree/main/packages/graphiql#options
"GRAPHIQL_HEADER_EDITOR_ENABLED": False,
"GRAPHIQL_HEADER_EDITOR_ENABLED": True,
}
if settings.DEBUG:

View File

@ -175,7 +175,7 @@
onEditQuery: onEditQuery,
onEditVariables: onEditVariables,
onEditOperationName: onEditOperationName,
headerEditorEnabled: GRAPHENE_SETTINGS.graphiqlHeaderEditorEnabled || false,
headerEditorEnabled: GRAPHENE_SETTINGS.graphiqlHeaderEditorEnabled || true,
query: parameters.query,
};
if (parameters.variables) {