Skip to content

Instantly share code, notes, and snippets.

@rxgx
Created August 22, 2019 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rxgx/0e8c5fe012d56b30865944c2c49e7283 to your computer and use it in GitHub Desktop.
Save rxgx/0e8c5fe012d56b30865944c2c49e7283 to your computer and use it in GitHub Desktop.
GraphQL request client
import { GraphQLClient } from 'graphql-request';
import authn from 'clients/authn';
import config from 'config';
const accessToken = authn.getToken('access_token');
const idToken = authn.getToken('id_token');
const graphQLClient = new GraphQLClient(config.apiGatewayUrl, {
headers: {
Authorization: accessToken,
id: idToken,
},
});
export default graphQLClient;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment