Skip to content
Permalink
Browse files

fix headers to use admin token

  • Loading branch information...
tadasant committed Jan 15, 2019
1 parent fe6f8f4 commit 2453d432d3238dd36c3a1acb7fd7bbbc41607076
Showing with 5 additions and 1 deletion.
  1. +5 −1 app/lambda/runGame.js
@@ -45,9 +45,13 @@ function runGame(event, context, callback) {

const headers = {
'Access-Control-Allow-Origin': '*',
'X-Hasura-Access-Token': process.env.HASURA_GRAPHQL_ACCESS_KEY
};

const client = new GraphQLClient(hasuraURL, { headers: {'admin-token': process.env.HASURA_GRAPHQL_ACCESS_KEY} });
console.log('headers');
console.log(headers);

const client = new GraphQLClient(hasuraURL, { headers });
client.request(hasuraURL, setLiveToCompleteQuery)
.then(() => {
client.request(buildGameStartQuery(questionId))

0 comments on commit 2453d43

Please sign in to comment.
You can’t perform that action at this time.