@things-factory/shell 6.0.76 → 6.0.82
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.
@@ -1,12 +1,29 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.GraphqlLocalClient = void 0;
|
4
|
-
const schema_1 = require("@apollo/client/link/schema");
|
5
4
|
const client_1 = require("@apollo/client");
|
5
|
+
const schema_1 = require("@apollo/client/link/schema");
|
6
|
+
const defaultOptions = {
|
7
|
+
watchQuery: {
|
8
|
+
fetchPolicy: 'no-cache',
|
9
|
+
errorPolicy: 'ignore'
|
10
|
+
},
|
11
|
+
query: {
|
12
|
+
fetchPolicy: 'no-cache',
|
13
|
+
errorPolicy: 'all'
|
14
|
+
},
|
15
|
+
mutate: {
|
16
|
+
errorPolicy: 'all'
|
17
|
+
}
|
18
|
+
};
|
19
|
+
const cache = new client_1.InMemoryCache({
|
20
|
+
addTypename: false
|
21
|
+
});
|
6
22
|
class GraphqlLocalClient {
|
7
23
|
static init(schema, app) {
|
8
24
|
GraphqlLocalClient.client = new client_1.ApolloClient({
|
9
|
-
|
25
|
+
defaultOptions,
|
26
|
+
cache,
|
10
27
|
link: new schema_1.SchemaLink({
|
11
28
|
schema,
|
12
29
|
context: (obj, args, context, info) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"graphql-local-client.js","sourceRoot":"","sources":["../server/graphql-local-client.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;
|
1
|
+
{"version":3,"file":"graphql-local-client.js","sourceRoot":"","sources":["../server/graphql-local-client.ts"],"names":[],"mappings":";;;AAAA,2CAAmF;AACnF,uDAAuD;AAEvD,MAAM,cAAc,GAAQ;IAC1B,UAAU,EAAE;QACV,WAAW,EAAE,UAAU;QACvB,WAAW,EAAE,QAAQ;KACtB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,UAAU;QACvB,WAAW,EAAE,KAAK;KACnB;IACD,MAAM,EAAE;QACN,WAAW,EAAE,KAAK;KACnB;CACF,CAAA;AAED,MAAM,KAAK,GAAG,IAAI,sBAAa,CAAC;IAC9B,WAAW,EAAE,KAAK;CACnB,CAAC,CAAA;AACF,MAAa,kBAAkB;IAG7B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;QACrB,kBAAkB,CAAC,MAAM,GAAG,IAAI,qBAAY,CAAC;YAC3C,cAAc;YACd,KAAK;YACL,IAAI,EAAE,IAAI,mBAAU,CAAC;gBACnB,MAAM;gBACN,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;oBACpC,uCACK,GAAG,CAAC,UAAU,EAAE,KACnB,GAAG,IACJ;gBACH,CAAC;aACF,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;CACF;AAlBD,gDAkBC","sourcesContent":["import { ApolloClient, InMemoryCache, NormalizedCacheObject } from '@apollo/client'\nimport { SchemaLink } from '@apollo/client/link/schema'\n\nconst defaultOptions: any = {\n watchQuery: {\n fetchPolicy: 'no-cache',\n errorPolicy: 'ignore'\n },\n query: {\n fetchPolicy: 'no-cache',\n errorPolicy: 'all'\n },\n mutate: {\n errorPolicy: 'all'\n }\n}\n\nconst cache = new InMemoryCache({\n addTypename: false\n})\nexport class GraphqlLocalClient {\n static client: ApolloClient<NormalizedCacheObject>\n\n static init(schema, app) {\n GraphqlLocalClient.client = new ApolloClient({\n defaultOptions,\n cache,\n link: new SchemaLink({\n schema,\n context: (obj, args, context, info) => {\n return {\n ...obj.getContext(),\n app\n }\n }\n })\n })\n }\n}\n"]}
|