Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 660 Bytes

custom-parameters.md

File metadata and controls

29 lines (23 loc) · 660 Bytes

Custom GraphiQL parameters

By default, only the fetcher parameter is passed to GraphiQL's React component. To add more:

  1. Override the default GraphiQL template:
# config/packages/graphiql.yaml or app/config/config.yml for Symfony without Flex
overblog_graphiql:
    template: "GraphiQL/index.html.twig"
  1. Create a new template:
{# templates/GraphiQL/index.html.twig #}
{% extends '@OverblogGraphiQL/GraphiQL/index.html.twig' %}

{% block graphiql_params %}
{{ parent() }},
defaultQuery: `query SomeQuery($param: String) {
  items(param: $param) {
    someField
  }
}`
{% endblock graphiql_params %}