@acrool/graphql-codegen-rtk-query
Advanced tools
Comparing version 0.0.3-test.4 to 0.0.3-test.5
@@ -17,4 +17,13 @@ import { GraphQLSchema, OperationDefinitionNode } from 'graphql'; | ||
private injectTransformResponse; | ||
/** | ||
* Generate subscription Hook | ||
* @param node | ||
* @param documentVariableName | ||
* @param operationName | ||
* @param operationResultType | ||
* @param operationVariablesTypes | ||
* @param hasRequiredVariables | ||
*/ | ||
generateSubscriptionHook(node: OperationDefinitionNode, documentVariableName: string, operationName: string, operationResultType: string, operationVariablesTypes: string, hasRequiredVariables: boolean): string; | ||
protected buildOperation(node: OperationDefinitionNode, documentVariableName: string, operationType: 'Query' | 'Mutation' | 'Subscription', operationResultType: string, operationVariablesTypes: string, hasRequiredVariables: boolean): string; | ||
} |
@@ -67,3 +67,3 @@ "use strict"; | ||
(this.config.exportHooks | ||
? `${this._subscription.join(', ')}` | ||
? `${this._subscription.join('\n')}` | ||
: '') + | ||
@@ -79,7 +79,13 @@ '\n\n'); | ||
} | ||
/** | ||
* Generate subscription Hook | ||
* @param node | ||
* @param documentVariableName | ||
* @param operationName | ||
* @param operationResultType | ||
* @param operationVariablesTypes | ||
* @param hasRequiredVariables | ||
*/ | ||
generateSubscriptionHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) { | ||
const variables = `args${hasRequiredVariables ? '' : '?'}: SubscriptionHookOptions<TData, ${operationVariablesTypes}>`; | ||
// const hookConfig = this.visitor.queryMethodMap; | ||
// this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.subscription.hook); | ||
// this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.subscription.options); | ||
const typedFetcher = `useSubscription<TData, ${operationVariablesTypes}>`; | ||
@@ -86,0 +92,0 @@ ; |
{ | ||
"name": "@acrool/graphql-codegen-rtk-query", | ||
"version": "0.0.3-test.4", | ||
"version": "0.0.3-test.5", | ||
"description": "trk-query for graphql-code-generator", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21476
358