UNPKG

1.04 kBSource Map (JSON)View Raw
1{"version":3,"file":"checkFetcher.js","sourceRoot":"","sources":["../../../src/link/http/checkFetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,CAAC,IAAM,YAAY,GAAG,UAAC,OAAuD;IAClF,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAC5C,MAAM,IAAI,cAAc,CAAC,obAWxB,CAAC,CAAC;KACJ;AACH,CAAC,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals';\n\nexport const checkFetcher = (fetcher: WindowOrWorkerGlobalScope['fetch'] | undefined) => {\n if (!fetcher && typeof fetch === 'undefined') {\n throw new InvariantError(`\n\"fetch\" has not been found globally and no fetcher has been \\\nconfigured. To fix this, install a fetch package (like \\\nhttps://www.npmjs.com/package/cross-fetch), instantiate the \\\nfetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n `);\n }\n};\n"]}
\No newline at end of file