aboutsummaryrefslogblamecommitdiffstats
path: root/webui/src/apollo.ts
blob: 3482df5410d1b7831d85598d4fd03aeb26f78177 (plain) (tree)
1
2
3
4
5
6
7
8
                                                             
 
                                                  



                                 
                                                     


                                                                                           
                            

        



                      
import { ApolloClient, InMemoryCache } from '@apollo/client';

import introspectionResult from './fragmentTypes';

const client = new ApolloClient({
  uri: '/graphql',
  cache: new InMemoryCache({
    possibleTypes: introspectionResult.possibleTypes,
    typePolicies: {
      // TODO: For now, we only query the default repository, so consider it as a singleton
      Repository: {
        keyFields: ['name'],
      },
    },
  }),
});

export default client;