@technicity/data-service-generator 0.11.0-next.0 → 0.12.0-next.0

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.
@@ -249,7 +249,7 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
249
249
  param1: ${findOnes
250
250
  .map((findOne) => `{ ${findOne.name}: ${findOne.type}${findOne.nullable ? " | null" : ""} }`)
251
251
  .join(" | ")},
252
- param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, context?: TContext }
252
+ param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, skipCache?: boolean, context?: TContext }
253
253
  ): Promise<${x.typeReturnBaseName}> {
254
254
  return this.runtime.resolve(
255
255
  {
@@ -258,7 +258,8 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
258
258
  args: { $where: param1 },
259
259
  fields: param2?.fields,
260
260
  artifacts,
261
- context: param2?.context
261
+ context: param2?.context,
262
+ skipCache: param2?.skipCache
262
263
  }
263
264
  );
264
265
  }`;
@@ -266,7 +267,7 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
266
267
  if (x.kind === "getList") {
267
268
  return `async ${x.methodName}(
268
269
  param1: { $where?: ${x.typeWhereName}, $orderBy?: ${x.typeOrderByName}, $limit?: number },
269
- param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, context?: TContext }
270
+ param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, skipCache?: boolean, context?: TContext }
270
271
  ): Promise<Array<${x.typeReturnBaseName}>> {
271
272
  return this.runtime.resolve(
272
273
  {
@@ -275,7 +276,8 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
275
276
  args: param1,
276
277
  fields: param2?.fields,
277
278
  artifacts,
278
- context: param2?.context
279
+ context: param2?.context,
280
+ skipCache: param2?.skipCache
279
281
  }
280
282
  );
281
283
  }`;
@@ -283,7 +285,7 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
283
285
  if (x.kind === "getListPaginated") {
284
286
  return `async ${x.methodName}(
285
287
  param1: { $where?: ${x.typeWhereName}, $orderBy?: ${x.typeOrderByName}, $paginate: Paginate },
286
- param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, context?: TContext }
288
+ param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, skipCache?: boolean, context?: TContext }
287
289
  ): Promise<ListPaginated<${x.typeReturnBaseName}>> {
288
290
  return this.runtime.resolve(
289
291
  {
@@ -292,7 +294,8 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
292
294
  args: param1,
293
295
  fields: param2?.fields,
294
296
  artifacts,
295
- context: param2?.context
297
+ context: param2?.context,
298
+ skipCache: param2?.skipCache
296
299
  }
297
300
  );
298
301
  }`;
@@ -14,6 +14,7 @@ export declare type TResolveParams = {
14
14
  artifacts: IArtifacts;
15
15
  fields?: IField[] | undefined;
16
16
  context?: TContext | undefined;
17
+ skipCache?: boolean;
17
18
  };
18
19
  export declare type TContext = {
19
20
  [k: string]: any;
@@ -46,7 +46,7 @@ function _resolve(input, dbCall, formatQuery, beginTransaction, dialect, context
46
46
  case "findUnique":
47
47
  case "findMany":
48
48
  case "findManyPaginated":
49
- return cache ?
49
+ return cache && !input.skipCache ?
50
50
  getCached(input, dbCall, formatQuery, dialect, cache) :
51
51
  getData(input, dbCall, formatQuery, dialect);
52
52
  case "create":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technicity/data-service-generator",
3
- "version": "0.11.0-next.0",
3
+ "version": "0.12.0-next.0",
4
4
  "main": "./dist/index.js",
5
5
  "files": [
6
6
  "dist"