How to use @shopify/react-graphql - 2 common examples

To help you get started, we’ve selected a few @shopify/react-graphql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / quilt / packages / react-graphql-universal-provider / src / GraphQLUniversalProvider.tsx View on Github external
>(() => {
    const clientOptions = createClientOptions();
    const link = createSsrExtractableLink();

    const apolloClient = new ApolloClient({
      ...clientOptions,
      link: clientOptions.link ? link.concat(clientOptions.link) : link,
      cache: initialData
        ? clientOptions.cache.restore(initialData)
        : clientOptions.cache,
    });

    return [apolloClient, link];
  }).current;
github Shopify / quilt / packages / react-self-serializers / src / GraphQLComponent.tsx View on Github external
>(() => {
    const link = createSsrExtractableLink();
    const client = createClient();
    client.link = link.concat(client.link);

    if (initialData) {
      client.cache = client.cache.restore(initialData);
    }

    return [client, link];
  }).current;

@shopify/react-graphql

Tools for creating type-safe and asynchronous GraphQL components for React

MIT
Latest version published 3 days ago

Package Health Score

95 / 100
Full package analysis

Popular @shopify/react-graphql functions

Similar packages