Created
July 17, 2017 20:14
-
-
Save auser/8d3f1ba7ded9f05398075972e55c2a35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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