{"id":46959,"library":"apollo-fetch","title":"Apollo Fetch","description":"A lightweight, minimalistic implementation of fetch specifically designed for GraphQL requests from the Apollo ecosystem. Version 0.7.0 (latest), not actively maintained—superseded by Apollo Client's built-in HTTP link. Provides a simple fetch-based interface for executing GraphQL queries and mutations. Unlike full Apollo Client, it offers no caching, state management, or React integration; purely a network layer. Ships TypeScript declarations. Low release cadence, no updates since 2018.","status":"deprecated","version":"0.7.0","language":"javascript","source_language":"en","source_url":"https://github.com/apollographql/apollo-fetch/tree/master/packages/apollo-fetch","tags":["javascript","typescript"],"install":[{"cmd":"npm install apollo-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add apollo-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add apollo-fetch","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"polyfills fetch for Node.js and older browsers","package":"cross-fetch","optional":true}],"imports":[{"note":"Named export, not default.","wrong":"import createApolloFetch from 'apollo-fetch'","symbol":"createApolloFetch","correct":"import { createApolloFetch } from 'apollo-fetch'"},{"note":"Type import only for TypeScript.","wrong":"const { ApolloFetch } = require('apollo-fetch')","symbol":"ApolloFetch","correct":"import { ApolloFetch } from 'apollo-fetch'"},{"note":"Named exports, not a default via CJS.","wrong":"const apolloFetch = require('apollo-fetch')","symbol":"(entire module)","correct":"const { createApolloFetch } = require('apollo-fetch')"}],"quickstart":{"code":"const { createApolloFetch } = require('apollo-fetch');\n\nconst fetch = createApolloFetch({ uri: process.env.GRAPHQL_URI ?? 'http://localhost:4000/graphql' });\n\nfetch({ query: `{ __typename }` }).then(result => {\n  console.log(result.data);\n}).catch(err => {\n  console.error(err);\n});","lang":"typescript","description":"Creates an ApolloFetch instance and sends a simple GraphQL query using a URI from environment."},"warnings":[{"fix":"Migrate to @apollo/client and use createHttpLink.","message":"Apollo Fetch is deprecated in favor of Apollo Client's HttpLink.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Use Apollo Client for full subscription support.","message":"No built-in support for subscriptions; only queries and mutations.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.7.0':19 '2018':73 'activ':22 'apollo':1,16,26,49 'base':39 'built':30 'built-in':29 'cach':54 'cadenc':69 'client':27,50 'declar':66 'design':10 'ecosystem':17 'execut':42 'fetch':2,8,38 'fetch-bas':37 'full':48 'graphql':12,43 'http':32 'implement':6 'integr':59 'interfac':40 'javascript':74 'latest':20 'layer':63 'lightweight':4 'link':33 'low':67 'maintain':23 'manag':56 'minimalist':5 'mutat':46 'network':62 'offer':52 'provid':34 'pure':60 'queri':44 'react':58 'releas':68 'request':13 'ship':64 'simpl':36 'sinc':72 'specif':9 'state':55 'supersed':24 'typescript':65,75 'unlik':47 'updat':71 'version':18","created_at":"2026-06-07T16:49:02.415877+00:00","updated_at":"2026-06-07T16:49:02.415877+00:00","problems":[{"fix":"Install cross-fetch: npm install cross-fetch and add at top: require('cross-fetch/polyfill')","cause":"Missing fetch polyfill in Node.js or older browser.","error":"TypeError: fetch is not a function"},{"fix":"Check your network and graphql endpoint, handle errors properly: fetch({query}).then(({data, errors}) => { if (errors) console.error(errors); })","cause":"GraphQL response contains errors or network failure; no data property.","error":"Uncaught (in promise) TypeError: Cannot destructure property 'data' of '(intermediate value)' as it is undefined."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/apollographql/apollo-fetch#readme","github":"https://github.com/apollographql/apollo-fetch/tree/master/packages/apollo-fetch","docs":null,"changelog":null,"pypi":null,"npm":"apollo-fetch","openapi_spec":null,"status_page":null,"smithery":null,"categories":["api"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}