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

  • const client = new ApolloClient({
      cache: new InMemoryCache().restore(JSON.parse(window.__APOLLO_STATE__)),
      link,
      ssrForceFetchDelay: 100, // in milliseconds
    });
    Docs
  • import { ApolloClient, InMemoryCache } from '@apollo/client';
    
    const client = new ApolloClient({
      cache: new InMemoryCache(),
      resolvers: {
        Mutation: {
          updateUserEmail: (_, { id, email }, { cache }) => {
            cache.writeFragment({
              id: cache.identify({ __typename: "User", id }),
              fragment: gql`fragment UserEmail on User { email }`,
              data: { email },
            });
          },
        },
      },
    };
    Docs
  • import { ApolloClient, InMemoryCache } from '@apollo/client';
    
    const client = new ApolloClient({
      cache: new InMemoryCache(),
      resolvers: {
        Mutation: {
          toggleTodo: (_root, variables, { cache }) => {
            cache.modify({
              id: cache.identify({
                __typename: 'TodoItem',
                id: variables.id,
              }),
              fields: {
                completed: value => !value,
              },
            });
            return null;
          },
        },
      },
    });
    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
  • import { ApolloClient, InMemoryCache } from '@apollo/client';
    
    const client = new ApolloClient({
      cache: new InMemoryCache(),
      resolvers: {
        Mutation: {
          updateVisibilityFilter: (_, { visibilityFilter }, { cache }) => {
            cache.writeQuery({
              query: gql`query GetVisibilityFilter { visibilityFilter }`,
              data: {
                __typename: 'Filter',
                visibilityFilter,
              },
            });
          },
        },
      },
    };
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples