Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

fix(graphiql): request headers not submitted with the request #483

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@

var headers = ${headers}

function onEditHeaders(newHeaders) {
try {
headers = JSON.parse(newHeaders)
} catch(e) {
headers = {}
}
}

// Defines a GraphQL fetcher using the fetch API. You're not required to
// use fetch, and could instead implement graphQLFetcher however you like,
// as long as it returns a Promise or Observable.
Expand Down Expand Up @@ -153,6 +161,7 @@
props.onEditQuery = onEditQuery
props.onEditVariables = onEditVariables
props.onEditOperationName = onEditOperationName
props.onEditHeaders = onEditHeaders

console.debug(props)
// Render <GraphiQL /> into the body.
Expand Down