I am implementing using @apollo/client
, but i do not see any complete example of @apollo/client
with react
.
If i search i get example with apollo-client
and apollo boost
.
What is the difference between all 3.
I understand @apollo/client
is the new version of all. Where can i get complete example of @apollo/client
with react
application?
import { ApolloClient, InMemoryCache, ApolloLink, createHttpLink, defaultDataIdFromObject } from '@apollo/client';
import { ApolloClient, InMemoryCache, ApolloLink } from 'apollo-boost';
Apollo Boost includes some packages that we think are essential to developing with Apollo Client. Here's what's in the box:
apollo-client
: Where all the magic happensapollo-cache-inmemory
: Our recommended cacheapollo-link-http
: An Apollo Link for remote data fetchingapollo-link-error
: An Apollo Link for error handlinggraphql-tag
: Exports the gql function for your queries & mutationsThe awesome thing about Apollo Boost is that you don't have to set any of this up yourself! Just specify a few options if you'd like to use these features and we'll take care of the rest. For a full list of available options, please refer to the Apollo Boost configuration options documentation.
The old version(below 3.x) apollo client
The latest version(3.x+) apollo client published as Scoped packages
Check the official get started example