1.0.0 • Published 7 years ago

graphiql-custom-headers v1.0.0

Weekly downloads
7
License
SEE LICENSE IN LI...
Repository
github
Last release
7 years ago

GraphiQL - With Custom Headers

Checkout the GraphiQL documentation on https://github.com/graphql/graphiql

To allow Custom Headers feature your graphQLFetcher might take an extra argument and supply it instead of headers:

function graphQLFetcher(graphQLParams, myCustomHeaders) {
  return fetch(window.location.origin + '/graphql', {
    method: 'post',
    headers: myCustomHeaders,
    body: JSON.stringify(graphQLParams),
  }).then(response => response.json());
}

Copyright (c) 2015, Facebook, Inc. All rights reserved.