@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.cjs
CHANGED
|
@@ -5826,14 +5826,14 @@ var GraphQLClient = class {
|
|
|
5826
5826
|
});
|
|
5827
5827
|
}
|
|
5828
5828
|
async query(request) {
|
|
5829
|
-
const { query, variables } = request;
|
|
5830
|
-
const result = await this.$__client.query(query, variables || {}).toPromise();
|
|
5829
|
+
const { query, variables, context } = request;
|
|
5830
|
+
const result = await this.$__client.query(query, variables || {}, context).toPromise();
|
|
5831
5831
|
return this.formatResponse(result);
|
|
5832
5832
|
}
|
|
5833
5833
|
async mutation(request) {
|
|
5834
|
-
const { query, variables } = request;
|
|
5834
|
+
const { query, variables, context } = request;
|
|
5835
5835
|
const mutationString = request.mutation || query;
|
|
5836
|
-
const result = await this.$__client.mutation(mutationString, variables || {}).toPromise();
|
|
5836
|
+
const result = await this.$__client.mutation(mutationString, variables || {}, context).toPromise();
|
|
5837
5837
|
return this.formatResponse(result);
|
|
5838
5838
|
}
|
|
5839
5839
|
// Alias for mutation() to match JS SDK interface
|
|
@@ -10384,7 +10384,7 @@ var KnishIOClient = class {
|
|
|
10384
10384
|
/**
|
|
10385
10385
|
* Executes a query or mutation
|
|
10386
10386
|
*/
|
|
10387
|
-
async executeQuery(query, variables = null) {
|
|
10387
|
+
async executeQuery(query, variables = null, context = {}) {
|
|
10388
10388
|
if (this.$__authToken && this.$__authToken.isExpired() && !this.$__authInProcess) {
|
|
10389
10389
|
this.log("info", "KnishIOClient::executeQuery() - Access token is expired. Getting new one...");
|
|
10390
10390
|
await this.requestAuthToken({
|
|
@@ -10400,7 +10400,7 @@ var KnishIOClient = class {
|
|
|
10400
10400
|
return response;
|
|
10401
10401
|
});
|
|
10402
10402
|
}
|
|
10403
|
-
return await query.execute({ variables: variables || {} });
|
|
10403
|
+
return await query.execute({ variables: variables || {}, context });
|
|
10404
10404
|
}
|
|
10405
10405
|
/**
|
|
10406
10406
|
* When a ProposeMolecule submission is rejected for a position-related
|
|
@@ -10733,7 +10733,8 @@ var KnishIOClient = class {
|
|
|
10733
10733
|
throughMolecule = false,
|
|
10734
10734
|
values = null,
|
|
10735
10735
|
keys = null,
|
|
10736
|
-
atomValues = null
|
|
10736
|
+
atomValues = null,
|
|
10737
|
+
requestPolicy = null
|
|
10737
10738
|
}) {
|
|
10738
10739
|
this.log("info", `KnishIOClient::queryMeta() - Querying metaType: ${metaType}, metaId: ${metaId}...`);
|
|
10739
10740
|
let query;
|
|
@@ -10785,7 +10786,8 @@ var KnishIOClient = class {
|
|
|
10785
10786
|
cellSlug: this.getCellSlug()
|
|
10786
10787
|
});
|
|
10787
10788
|
}
|
|
10788
|
-
|
|
10789
|
+
const context = requestPolicy ? { requestPolicy } : {};
|
|
10790
|
+
return this.executeQuery(query, variables, context);
|
|
10789
10791
|
}
|
|
10790
10792
|
/**
|
|
10791
10793
|
* Queries meta assets and verifies cryptographic integrity of associated molecules.
|