Skip to content

local cache from GraphQL based on object type as a root key #699

@satanTime

Description

@satanTime

A possible solution is to use ApolloLink:

        // gqlHandleResponse is our handler from the library

        const addDateLink = new ApolloLink((operation, forward) =>
          forward(operation).map(gqlHandleResponse),
        );

        // eslint-disable-next-line unicorn/prefer-spread
        const link = addDateLink.concat(
          httpLink.create({
            uri,
          }),
        );

        return {
          cache: new InMemoryCache(),
          link,
        };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions