367 votes
0 answers
typescript - Pass a custom fetch function into Apollo client?
Solution:
This requires building alink
and passing yourcustomFetch
function:
import { ApolloLink, HttpLink, from } from '@apollo/client';
const uri = 'https://yourserver/graphql';
const customFetch = (uri, options) => {
// do your thing
};
// define any other links… ex: link1, link2
const httpLink = new HttpLink({ uri, fetch: customFetch });
export const link = from([link1, link2, httpLink]);
Undefined asked
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.