Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Introspection Fragment Matcher
import ApolloClient from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { HttpLink } from 'apollo-link-http';
import { IntrospectionFragmentMatcher } from 'apollo-cache-inmemory';
import introspectionQueryResultData from './fragmentTypes.json';
const fragmentMatcher = new IntrospectionFragmentMatcher({
introspectionQueryResultData
});
const cookies = new Cookies();
const httpLink = new HttpLink({ uri: 'https://api.example.com/graphql' })
const cache = new InMemoryCache({ fragmentMatcher });
export const client = new ApolloClient({
cache,
link: new HttpLink(),
});
@pankajnegi1893

This comment has been minimized.

Copy link

@pankajnegi1893 pankajnegi1893 commented Oct 30, 2019

where is fragmentTypes.json file ??

@chandan-reddy-k

This comment has been minimized.

Copy link
Owner Author

@chandan-reddy-k chandan-reddy-k commented Oct 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment