const apolloSetup = () => { const retry = new RetryLink({ attempts: { max: Infinity } }); const http = new HttpLink({ uri: 'https://api.marvelql.com/' }); const link = concat(retry, http); const cache = new InMemoryCache(); const storage = window.localStorage; const waitOnCache = persistCache({ cache, storage }); const client = new ApolloClient({ cache, link, resolvers }); return { waitOnCache, client }; }