Welcome to mirror list, hosted at ThFree Co, Russian Federation.

graphql.js « boards « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d8d16184936a5e355d86da3589d3a5ed2ecce3f9 (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, defaultDataIdFromObject } from 'apollo-cache-inmemory';
import createDefaultClient from '~/lib/graphql';
import introspectionQueryResultData from '~/sidebar/fragmentTypes.json';

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

export const gqlClient = createDefaultClient(
  {},
  {
    cacheConfig: {
      dataIdFromObject: (object) => {
        // eslint-disable-next-line no-underscore-dangle
        return object.__typename === 'BoardList' ? object.iid : defaultDataIdFromObject(object);
      },

      fragmentMatcher,
    },
    assumeImmutableResults: true,
  },
);