12345678910111213 |
- const getGQL = url =>
- (query, variables={}) =>
- fetch(url,
- {method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- ...(localStorage.authToken ? {Authorization: `Bearer ${localStorage.authToken}`} : {})
- },
- body: JSON.stringify({query,variables})})
- .then(res => res.json())
- const gql = getGQL("http://shop-roles.asmer.fs.a-level.com.ua/graphql");
|