12345678910111213141516 |
- 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());
- export const gql = getGQL("/graphql");
|