@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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugin.mjs +14 -3
- 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,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
|
-
|
|
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
|
-
|
|
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(
|