Skip to content

Instantly share code, notes, and snippets.

@auser
Created July 17, 2017 20:14
Show Gist options
  • Save auser/8d3f1ba7ded9f05398075972e55c2a35 to your computer and use it in GitHub Desktop.
Save auser/8d3f1ba7ded9f05398075972e55c2a35 to your computer and use it in GitHub Desktop.
'use latest';
import isoFetch from 'isomorphic-fetch';
import {graphCoolEndpoint} from './constants';
const _getPlan = planId => {
const query = `{
Plan(id:"${planId}") {
id
}
}
`;
const variables = {planId: planId};
return isoFetch(graphCoolEndpoint, {
method: 'POST',
headers: {
Authorization: `Bearer ${__AUTHORIZATION_TOKEN__}`,
'content-type': 'application/json'
},
body: JSON.stringify({
query: query,
variables: variables
})
}).then(resp => resp.json());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment