Skip to content

Commit 4fa537c

Browse files
authored
Actually document variables["__globals__"] on the graphql endpoint (#9108)
It was in the changelog but nowhere else. If anybody has some bikesheddy suggestions for a better way to spell it in the docs, lmk.
1 parent 9910952 commit 4fa537c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/reference/using/graphql/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ Requests can contain the following fields:
104104
- ``variables`` - a JSON object containing a set of variables. **Optional**
105105
If the GraphQL query string contains variables, the ``variables`` object is
106106
required.
107-
- ``globals`` - a JSON object containing global variables. **Optional**. The
107+
- ``variables["__globals__"]`` - a JSON object containing global variables.
108+
**Optional**. The
108109
keys must be the fully qualified names of the globals to set (e.g.,
109110
``default::current_user`` for the global ``current_user`` in the ``default``
110111
module).
111112
- ``operationName`` - the name of the operation that must be
112113
executed. **Optional** If the GraphQL query contains several named
113114
operations, it is required.
115+
- ``globals`` - **Deprecated** and non-standard synonym for ``variables["__globals__"]``.
114116

115117
.. note::
116118

@@ -132,7 +134,7 @@ submit the following JSON-encoded form with the necessary fields.
132134
$ curl \
133135
-H "Content-Type: application/json" \
134136
-X POST http://localhost:10787/branch/main/graphql \
135-
-d '{ "query": "query getMovie($title: String!) { Movie(filter: {title:{eq: $title}}) { id title }}", "variables": { "title": "The Batman" }, "globals": {"default::current_user": "04e52807-6835-4eaa-999b-952804ab40a5"}}'
137+
-d '{ "query": "query getMovie($title: String!) { Movie(filter: {title:{eq: $title}}) { id title }}", "variables": { "title": "The Batman" , "__globals__": {"default::current_user": "04e52807-6835-4eaa-999b-952804ab40a5"}}}'
136138
{"data": {...}}
137139
138140
.. lint-on

0 commit comments

Comments
 (0)