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

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.13",
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.13";
9
9
 
10
10
  const logger = useLogger(name);
11
11
  async function readConfigFile(path) {
@@ -81,9 +81,9 @@ export default defineNuxtPlugin((nuxtApp) => {
81
81
  return context.value;
82
82
  });
83
83
  let baseLink = csrfLink.concat(authLink).concat(contextLink);
84
+ let persistedLink;
84
85
  if (clientConfig.persistedQueries) {
85
- const persistedLink = createPersistedQueryLink({ sha256, useGETForHashedQueries: true });
86
- baseLink = baseLink.concat(persistedLink);
86
+ persistedLink = createPersistedQueryLink({ sha256, useGETForHashedQueries: true });
87
87
  }
88
88
  const httpEndLink = createUploadLink({
89
89
  ...clientConfig?.httpLinkOptions && clientConfig.httpLinkOptions,
@@ -140,9 +140,20 @@ export default defineNuxtPlugin((nuxtApp) => {
140
140
  errorLink,
141
141
  baseLink,
142
142
  pusherLink,
143
- httpEndLink
143
+ ...clientConfig.persistedQueries ? [
144
+ split(
145
+ ({ query }) => {
146
+ const definition = getMainDefinition(query);
147
+ return definition.kind === "OperationDefinition" && definition.operation === "subscription";
148
+ },
149
+ persistedLink.concat(httpEndLink),
150
+ httpEndLink
151
+ )
152
+ ] : [httpEndLink]
144
153
  ]) : ApolloLink.from([
145
154
  errorLink,
155
+ ...clientConfig.persistedQueries ? [optionalPersistedLink] : [],
156
+ pusherLink,
146
157
  ...!wsLink ? [httpLink] : [
147
158
  ...clientConfig?.websocketsOnly ? [wsLink] : [
148
159
  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.13",
4
4
  "license": "MIT",
5
5
  "repository": "https://github.com/GambaLabs/apollo",
6
6
  "homepage": "https://apollo.nuxtjs.org",