@gambalabs/apollo 6.0.0-alpha.10 → 6.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gambalabs/apollo",
3
- "version": "6.0.0-alpha.10",
3
+ "version": "6.0.0-alpha.12",
4
4
  "configKey": "apollo",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0-rc.9"
package/dist/module.mjs CHANGED
@@ -5,7 +5,7 @@ import { useLogger, defineNuxtModule, createResolver, addTemplate, addPlugin, ad
5
5
  import GraphQLPlugin from '@rollup/plugin-graphql';
6
6
 
7
7
  const name = "@gambalabs/apollo";
8
- const version = "6.0.0-alpha.10";
8
+ const version = "6.0.0-alpha.12";
9
9
 
10
10
  const logger = useLogger(name);
11
11
  async function readConfigFile(path) {
@@ -81,9 +81,13 @@ export default defineNuxtPlugin((nuxtApp) => {
81
81
  return context.value;
82
82
  });
83
83
  let baseLink = csrfLink.concat(authLink).concat(contextLink);
84
+ let optionalPersistedLink;
84
85
  if (clientConfig.persistedQueries) {
85
86
  const persistedLink = createPersistedQueryLink({ sha256, useGETForHashedQueries: true });
86
- baseLink = baseLink.concat(persistedLink);
87
+ optionalPersistedLink = split(({ query }) => {
88
+ const definition = getMainDefinition(query);
89
+ return definition.kind === "OperationDefinition" && definition.operation === "query";
90
+ }, persistedLink);
87
91
  }
88
92
  const httpEndLink = createUploadLink({
89
93
  ...clientConfig?.httpLinkOptions && clientConfig.httpLinkOptions,
@@ -139,10 +143,13 @@ export default defineNuxtPlugin((nuxtApp) => {
139
143
  const link = pusherLink ? ApolloLink.from([
140
144
  errorLink,
141
145
  baseLink,
146
+ ...clientConfig.persistedQueries ? [optionalPersistedLink] : [],
142
147
  pusherLink,
143
148
  httpEndLink
144
149
  ]) : ApolloLink.from([
145
150
  errorLink,
151
+ ...clientConfig.persistedQueries ? [optionalPersistedLink] : [],
152
+ pusherLink,
146
153
  ...!wsLink ? [httpLink] : [
147
154
  ...clientConfig?.websocketsOnly ? [wsLink] : [
148
155
  split(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gambalabs/apollo",
3
- "version": "6.0.0-alpha.10",
3
+ "version": "6.0.0-alpha.12",
4
4
  "license": "MIT",
5
5
  "repository": "https://github.com/GambaLabs/apollo",
6
6
  "homepage": "https://apollo.nuxtjs.org",