Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Commit

Permalink
feat(*): Add default getAccessToken method, add default graphiql option
Browse files Browse the repository at this point in the history
Added a default function for getting the access token based on sending an authorization header, or
an access_token parameter. Turned graphiql on by default in non-production environments.
  • Loading branch information
Simon Wears committed Aug 30, 2017
1 parent 8a99d0e commit 7fc36e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/healthgraphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const deleteStrengthItem = require('mutations/strength-training/delete-item');
const editStrengthItem = require('mutations/strength-training/edit-item');

const DEFAULTS = {
getAccessToken () { },
graphiql: false
getAccessToken (req) { return req.headers.authorization || req.params.access_token },
graphiql: process.env.NODE_ENV !== 'production'
};

/**
Expand Down

0 comments on commit 7fc36e7

Please sign in to comment.