1 | import { ApolloLink } from '@apollo/client/link/core';
|
2 | import { setContext } from '@apollo/client/link/context';
|
3 | import { createPersistedQueryLink as createPersistedQueryLink$1 } from '@apollo/client/link/persisted-queries';
|
4 |
|
5 | const transformLink = setContext((_, context) => {
|
6 | const ctx = {};
|
7 | if (context.http) {
|
8 | ctx.includeQuery = context.http.includeQuery;
|
9 | ctx.includeExtensions = context.http.includeExtensions;
|
10 | }
|
11 | if (context.fetchOptions && context.fetchOptions.method) {
|
12 | ctx.method = context.fetchOptions.method;
|
13 | }
|
14 | return ctx;
|
15 | });
|
16 | const createPersistedQueryLink = (options) => ApolloLink.from([createPersistedQueryLink$1(options), transformLink]);
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export { createPersistedQueryLink };
|
23 |
|