@gambalabs/apollo 6.0.0-alpha.12 → 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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugin.mjs +12 -8
- package/package.json +1 -1
package/dist/module.json
CHANGED
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.
|
|
8
|
+
const version = "6.0.0-alpha.13";
|
|
9
9
|
|
|
10
10
|
const logger = useLogger(name);
|
|
11
11
|
async function readConfigFile(path) {
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -81,13 +81,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
81
81
|
return context.value;
|
|
82
82
|
});
|
|
83
83
|
let baseLink = csrfLink.concat(authLink).concat(contextLink);
|
|
84
|
-
let
|
|
84
|
+
let persistedLink;
|
|
85
85
|
if (clientConfig.persistedQueries) {
|
|
86
|
-
|
|
87
|
-
optionalPersistedLink = split(({ query }) => {
|
|
88
|
-
const definition = getMainDefinition(query);
|
|
89
|
-
return definition.kind === "OperationDefinition" && definition.operation === "query";
|
|
90
|
-
}, persistedLink);
|
|
86
|
+
persistedLink = createPersistedQueryLink({ sha256, useGETForHashedQueries: true });
|
|
91
87
|
}
|
|
92
88
|
const httpEndLink = createUploadLink({
|
|
93
89
|
...clientConfig?.httpLinkOptions && clientConfig.httpLinkOptions,
|
|
@@ -143,9 +139,17 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
143
139
|
const link = pusherLink ? ApolloLink.from([
|
|
144
140
|
errorLink,
|
|
145
141
|
baseLink,
|
|
146
|
-
...clientConfig.persistedQueries ? [optionalPersistedLink] : [],
|
|
147
142
|
pusherLink,
|
|
148
|
-
|
|
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]
|
|
149
153
|
]) : ApolloLink.from([
|
|
150
154
|
errorLink,
|
|
151
155
|
...clientConfig.persistedQueries ? [optionalPersistedLink] : [],
|