You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/graphiql/README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,8 @@ GraphiQL supports customization in UI and behavior by accepting React props and
167
167
168
168
-`variables`: an optional GraphQL string to use as the initial displayed query variables, if `undefined` is provided, the stored variables will be used.
169
169
170
+
-`headers`: an optional GraphQL string to use as the initial displayed request headers, if `undefined` is provided, the stored headers will be used.
171
+
170
172
-`operationName`: an optional name of which GraphQL operation should be executed.
171
173
172
174
-`response`: an optional JSON string to use as the initial displayed response. If not provided, no response will be initially shown. You might provide this if illustrating the result of the initial query.
@@ -175,12 +177,16 @@ GraphiQL supports customization in UI and behavior by accepting React props and
175
177
176
178
-`defaultQuery`: an optional GraphQL string to use when no query is provided and no stored query exists from a previous session. If `undefined` is provided, GraphiQL will use its own default query.
177
179
178
-
-`defaultVariableEditorOpen`: an optional boolean that sets whether or not to show the variables pane on startup. If not defined, it will be based off whether or not variables are present.
180
+
-`defaultVariableEditorOpen`: an optional boolean that sets whether or not to show the variables pane on startup. If not defined, it will be based off whether or not variables are present. (**deprecated** in favor of `defaultSecondaryEditorOpen`)
181
+
182
+
-`defaultSecondaryEditorOpen`: an optional boolean that sets whether or not to show the variables/headers pane on startup. If not defined, it will be based off whether or not variables and/or headers are present.
179
183
180
184
-`onEditQuery`: an optional function which will be called when the Query editor changes. The argument to the function will be the query string.
181
185
182
186
-`onEditVariables`: an optional function which will be called when the Query variable editor changes. The argument to the function will be the variables string.
183
187
188
+
-`onEditHeaders`: an optional function which will be called when the request headers editor changes. The argument to the function will be the headers string.
189
+
184
190
-`onEditOperationName`: an optional function which will be called when the operation name to be executed changes.
185
191
186
192
-`onToggleDocs`: an optional function which will be called when the docs will be toggled. The argument to the function will be a boolean whether the docs are now open or closed.
@@ -193,6 +199,8 @@ GraphiQL supports customization in UI and behavior by accepting React props and
193
199
194
200
-`docExplorerOpen`: an optional boolean which when `true` will ensure the `DocExplorer` is open by default when the user first renders the component. If the user has toggled the doc explorer on/off following this, however, the persisted UI state will override this default flag.
195
201
202
+
-`headerEditorEnabled`: an optional boolean which enables the header editor when `true`. Defaults to `false`.
203
+
196
204
### Children (dropped as of 1.0.0-rc.2)
197
205
198
206
-`<GraphiQL.Logo>`: Replace the GraphiQL logo with your own.
@@ -236,6 +244,7 @@ class CustomGraphiQL extends React.Component {
236
244
// GraphQL artifacts
237
245
query:'',
238
246
variables:'',
247
+
headers:'',
239
248
response:'',
240
249
241
250
// GraphQL Schema
@@ -252,6 +261,7 @@ class CustomGraphiQL extends React.Component {
252
261
// Custom Event Handlers
253
262
onEditQuery:null,
254
263
onEditVariables:null,
264
+
onEditHeaders:null,
255
265
onEditOperationName:null,
256
266
257
267
// GraphiQL automatically fills in leaf nodes when the query
0 commit comments