How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import { ApolloClient, InMemoryCache } from '@apollo/client';
    
    const client = new ApolloClient({
      cache: new InMemoryCache(),
      resolvers: { ... },
      typeDefs: { ... },
    });
    Docs
  • import React from 'react';
    import { render } from 'react-dom';
    import {
      ApolloClient,
      InMemoryCache,
      ApolloProvider,
      useQuery,
      gql
    } from "@apollo/client";
    
    const client = new ApolloClient({
      uri: 'https://48p1r2roz4.sse.codesandbox.io',
      cache: new InMemoryCache()
    });
    
    function App() {
      return (
        <div>
          <h2>My first Apollo app 🚀</h2>
        </div>
      );
    }
    
    render(
      <ApolloProvider client={client}>
        <App />
      </ApolloProvider>,
      document.getElementById('root'),
    );
    Docs
  • import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client';
    
    const client = new ApolloClient({
      cache: new InMemoryCache(),
      link: new HttpLink({ uri: 'http://localhost:4000/graphql' }),
    });
    
    client.setResolvers({ ... });
    Docs
  • const client = new ApolloClient({
      cache: new InMemoryCache(),
      uri: "http://localhost:4000/graphql"
    });
    
    ReactDOM.render(
      <ApolloProvider client={client}>
        <MyRootComponent />
      </ApolloProvider>,
      document.getElementById('root'),
    );
    Docs
  • import { ApolloClient, InMemoryCache } from '@apollo/client';
    
    const client = new ApolloClient({
      cache: new InMemoryCache({
        typePolicies: {
          Query: {
            fields: {
              book: {
                read(_, { args, toReference }) {
                  return toReference({
                    __typename: 'Book',
                    id: args.id,
                  });
                }
              }
            }
          }
        }
      })
    });
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples