summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/sidebar/graphql.js
blob: 8615b52f1b8c80986bed1dbabd0e3ecc99ad58c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { IntrospectionFragmentMatcher } from 'apollo-cache-inmemory';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import introspectionQueryResultData from './fragmentTypes.json';

const fragmentMatcher = new IntrospectionFragmentMatcher({
  introspectionQueryResultData,
});

export const defaultClient = createDefaultClient(
  {},
  {
    cacheConfig: {
      fragmentMatcher,
    },
    assumeImmutableResults: true,
  },
);

export const apolloProvider = new VueApollo({
  defaultClient,
});