@wishknish/knishio-client-ts 0.8.1 → 0.8.2
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/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.iife.js +10 -8
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/KnishIOClient.ts +20 -5
- package/src/libraries/GraphQLClient.ts +7 -4
- package/src/types/index.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -5820,14 +5820,14 @@ var GraphQLClient = class {
|
|
|
5820
5820
|
});
|
|
5821
5821
|
}
|
|
5822
5822
|
async query(request) {
|
|
5823
|
-
const { query, variables } = request;
|
|
5824
|
-
const result = await this.$__client.query(query, variables || {}).toPromise();
|
|
5823
|
+
const { query, variables, context } = request;
|
|
5824
|
+
const result = await this.$__client.query(query, variables || {}, context).toPromise();
|
|
5825
5825
|
return this.formatResponse(result);
|
|
5826
5826
|
}
|
|
5827
5827
|
async mutation(request) {
|
|
5828
|
-
const { query, variables } = request;
|
|
5828
|
+
const { query, variables, context } = request;
|
|
5829
5829
|
const mutationString = request.mutation || query;
|
|
5830
|
-
const result = await this.$__client.mutation(mutationString, variables || {}).toPromise();
|
|
5830
|
+
const result = await this.$__client.mutation(mutationString, variables || {}, context).toPromise();
|
|
5831
5831
|
return this.formatResponse(result);
|
|
5832
5832
|
}
|
|
5833
5833
|
// Alias for mutation() to match JS SDK interface
|
|
@@ -10378,7 +10378,7 @@ var KnishIOClient = class {
|
|
|
10378
10378
|
/**
|
|
10379
10379
|
* Executes a query or mutation
|
|
10380
10380
|
*/
|
|
10381
|
-
async executeQuery(query, variables = null) {
|
|
10381
|
+
async executeQuery(query, variables = null, context = {}) {
|
|
10382
10382
|
if (this.$__authToken && this.$__authToken.isExpired() && !this.$__authInProcess) {
|
|
10383
10383
|
this.log("info", "KnishIOClient::executeQuery() - Access token is expired. Getting new one...");
|
|
10384
10384
|
await this.requestAuthToken({
|
|
@@ -10394,7 +10394,7 @@ var KnishIOClient = class {
|
|
|
10394
10394
|
return response;
|
|
10395
10395
|
});
|
|
10396
10396
|
}
|
|
10397
|
-
return await query.execute({ variables: variables || {} });
|
|
10397
|
+
return await query.execute({ variables: variables || {}, context });
|
|
10398
10398
|
}
|
|
10399
10399
|
/**
|
|
10400
10400
|
* When a ProposeMolecule submission is rejected for a position-related
|
|
@@ -10727,7 +10727,8 @@ var KnishIOClient = class {
|
|
|
10727
10727
|
throughMolecule = false,
|
|
10728
10728
|
values = null,
|
|
10729
10729
|
keys = null,
|
|
10730
|
-
atomValues = null
|
|
10730
|
+
atomValues = null,
|
|
10731
|
+
requestPolicy = null
|
|
10731
10732
|
}) {
|
|
10732
10733
|
this.log("info", `KnishIOClient::queryMeta() - Querying metaType: ${metaType}, metaId: ${metaId}...`);
|
|
10733
10734
|
let query;
|
|
@@ -10779,7 +10780,8 @@ var KnishIOClient = class {
|
|
|
10779
10780
|
cellSlug: this.getCellSlug()
|
|
10780
10781
|
});
|
|
10781
10782
|
}
|
|
10782
|
-
|
|
10783
|
+
const context = requestPolicy ? { requestPolicy } : {};
|
|
10784
|
+
return this.executeQuery(query, variables, context);
|
|
10783
10785
|
}
|
|
10784
10786
|
/**
|
|
10785
10787
|
* Queries meta assets and verifies cryptographic integrity of associated molecules.
|