/
apollo-client-config.js
54 lines (46 loc) · 1.65 KB
/
apollo-client-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export default {
default: {
// 'apollo-link-http' config
// https://www.apollographql.com/docs/link/links/http/#options
httpLinkConfig: {
// you can define the 'uri' here or using an env variable when
// running quasar commands, for example:
// `GRAPHQL_URI=https://prod.example.com/graphql quasar build`
// `GRAPHQL_URI=https://dev.example.com/graphql quasar dev`
uri: process.env.GRAPHQL_URI || '<%= prompts.graphql_uri %>'
},
// 'apollo-cache-inmemory' config
// https://www.apollographql.com/docs/react/caching/cache-configuration/#configuring-the-cache
cacheConfig: {},
// additional config for apollo client
// https://github.com/apollographql/apollo-client/blob/version-2.6/docs/source/api/apollo-client.mdx#optional-fields
additionalConfig: {}
},
// you can add more options or override the default config for a specific
// quasar mode or for dev and prod modes. Examples:
// ssr: {},
// dev: {
// httpLinkConfig: {
// uri: process.env.GRAPHQL_URI || 'http://dev.example.com/graphql'
// }
// },
// prod: {
// httpLinkConfig: {
// uri: process.env.GRAPHQL_URI || 'http://prod.example.com/graphql'
// }
// },
// the following gets merged to the config only when using ssr and on server
ssrOnServer: {
additionalConfig: {
// https://apollo.vuejs.org/guide/ssr.html#create-apollo-client
ssrMode: true
}
},
// the following gets merged to the config only when using ssr and on client
ssrOnClient: {
additionalConfig: {
// https://apollo.vuejs.org/guide/ssr.html#create-apollo-client
ssrForceFetchDelay: 100
}
}
}