Search code examples
graphqlreact-apolloapollo-clientapollo-boost

difference between @apollo/client , apollo-client and apollo boost


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';

Solution

    • 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 happens
    • apollo-cache-inmemory: Our recommended cache
    • apollo-link-http: An Apollo Link for remote data fetching
    • apollo-link-error: An Apollo Link for error handling
    • graphql-tag: Exports the gql function for your queries & mutations

    The 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.

    see What's in Apollo Boost

    • apollo-client

    The old version(below 3.x) apollo client

    • @apollo/client

    The latest version(3.x+) apollo client published as Scoped packages

    Check the official get started example