123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // export let url = "/graphql";
- // export let headers = {
- // Authorization: "Bearer " + localStorage.authToken,
- // // Authorization: `Bearer ${localStorage.authToken}`,
- // };
- // const originalFetch = fetch;
- // fetch = (
- // url,
- // params = {
- // headers: {},
- // }
- // )
- export const getGQL = (url, headers = {}) => (query = "", variables = {}) =>
- fetch(url, {
- method: "POST",
- headers: {
- Accept: "application/json",
- "Content-Type": "application/json",
- ...headers,
- },
- body: JSON.stringify({ query, variables }),
- }).then((res) => res.json());
- // export const gql = getGQL( "/graphql", {Authorization: "Bearer " + localStorage.authToken});
-
- // export let headers = {
- // Authorization: "Bearer " + localStorage.authToken,
- //когда проходит разлогин, то токен удаляется!!!!
- //localStorage.AuthTocken = ""-- something like this shold be
- //When sheet happen, first of all check your code
- //getGQL()() first we call function getGQL (getGQL()), after that we call the retsul of function ()
- // const
|