@acrool/graphql-codegen-apollo-subscription
Advanced tools
Comparing version 3.0.1-test.4 to 3.0.1-test.5
@@ -7,2 +7,7 @@ import { OperationDefinitionNode } from 'graphql'; | ||
private visitor; | ||
private _mapperQuery; | ||
private _mapperInfiniteQuery; | ||
private _mapperQueryClient; | ||
private _mapperMutation; | ||
private _isQueryAndQueryClient; | ||
constructor(visitor: ReactQueryVisitor, customFetcher: ReactQueryRawPluginConfig['fetcher']); | ||
@@ -9,0 +14,0 @@ private getSubscriptionFnName; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CustomMapperFetcher = void 0; | ||
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common"); | ||
class CustomMapperFetcher { | ||
constructor(visitor, customFetcher) { | ||
this.visitor = visitor; | ||
if (typeof customFetcher === 'undefined') { | ||
customFetcher = { | ||
queryFunc: 'createQueryHook', | ||
queryAndQueryClientFunc: 'createQueryAndQueryClientHook', | ||
infiniteQueryFunc: 'createInfiniteQueryHook', | ||
mutationFunc: 'createMutationHook', | ||
isQueryAndQueryClient: true, | ||
}; | ||
} | ||
this._mapperQuery = (0, visitor_plugin_common_1.parseMapper)(customFetcher.queryFunc); | ||
this._mapperQueryClient = (0, visitor_plugin_common_1.parseMapper)(customFetcher.queryAndQueryClientFunc); | ||
this._mapperInfiniteQuery = (0, visitor_plugin_common_1.parseMapper)(customFetcher.infiniteQueryFunc); | ||
this._mapperMutation = (0, visitor_plugin_common_1.parseMapper)(customFetcher.mutationFunc); | ||
this._isQueryAndQueryClient = customFetcher.isQueryAndQueryClient; | ||
} | ||
@@ -8,0 +23,0 @@ getSubscriptionFnName(operationResultType, operationVariablesTypes) { |
@@ -51,3 +51,8 @@ "use strict"; | ||
prepend: [...visitor.getImports()], | ||
content: [].join('\n'), | ||
content: [ | ||
`export enum EQueryKey{\n${operationNames.queryKey.join(',\n')}}`, | ||
`export enum EMutationKey{\n${operationNames.mutationKey.join(',\n')}}`, | ||
visitor.fragments, | ||
...visitorResult.definitions.filter(t => typeof t === 'string'), | ||
].join('\n'), | ||
}; | ||
@@ -54,0 +59,0 @@ } |
{ | ||
"name": "@acrool/graphql-codegen-apollo-subscription", | ||
"version": "3.0.1-test.4", | ||
"version": "3.0.1-test.5", | ||
"description": "react-query for graphql-code-generator", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
44284
597