@bitstack/ng-query-codegen-openapi 0.0.37 → 0.0.38-alpha.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.
@@ -81,21 +81,11 @@ export function generateRtkQueryFile(
81
81
  /**
82
82
  * ${info.summary}
83
83
  */
84
- ${info.operationName}LazyQuery(): {
85
- trigger: (args: IRestFulEndpointsQueryReturn<${info.argTypeName}>, options?: { skipCache?: boolean }) => Observable<${info.responseTypeName}>
86
- } {
87
- return {
88
- trigger: (args, options = {}) => {
89
- const { skipCache = true } = options;
90
- if (!skipCache) {
91
- const cachedResult = this.ntkQuery.getQueryCache<${info.responseTypeName}>([ECacheTagTypes.${info.queryKeyName}${!info.isVoidArg ? ', args.variables' : ''}]);
92
- if (cachedResult) {
93
- return cachedResult;
94
- }
95
- }
96
- return this.apiService.${info.operationName}(args);
97
- }
98
- };
84
+ ${info.operationName}LazyQuery(): LazyQueryResult<${info.responseTypeName}, IRestFulEndpointsQueryReturn<${info.argTypeName}>> {
85
+ return this.ntkQuery.lazyQuery<${info.responseTypeName}, IRestFulEndpointsQueryReturn<${info.argTypeName}>(
86
+ ECacheTagTypes.${info.queryKeyName},
87
+ (args) => this.apiService.${info.operationName}(args),
88
+ );
99
89
  }`
100
90
  )
101
91
  .join('');
@@ -106,7 +96,7 @@ export function generateRtkQueryFile(
106
96
  import {Injectable, inject} from '@angular/core';
107
97
  import {Observable} from 'rxjs';
108
98
  import {HttpErrorResponse} from '@angular/common/http';
109
- import {NtkQueryService, MutationState, QueryState, MutationResponse} from '@core/ntk-query';
99
+ import {NtkQueryService, MutationState, QueryState, MutationResponse, LazyQueryResult, LazyQueryTriggerOptions} from '@core/ntk-query';
110
100
  import {ECacheTagTypes} from '../tagTypes';
111
101
  import {${apiServiceName}} from './enhanceEndpoints';
112
102
  import {IRestFulEndpointsQueryReturn, RequestOptions} from '../common-types';