@acrool/graphql-codegen-apollo-subscription
Advanced tools
Comparing version 3.0.1-test.3 to 3.0.1-test.4
@@ -7,7 +7,2 @@ import { OperationDefinitionNode } from 'graphql'; | ||
private visitor; | ||
private _mapperQuery; | ||
private _mapperInfiniteQuery; | ||
private _mapperQueryClient; | ||
private _mapperMutation; | ||
private _isQueryAndQueryClient; | ||
constructor(visitor: ReactQueryVisitor, customFetcher: ReactQueryRawPluginConfig['fetcher']); | ||
@@ -14,0 +9,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; | ||
} | ||
@@ -23,0 +8,0 @@ getSubscriptionFnName(operationResultType, operationVariablesTypes) { |
@@ -51,8 +51,3 @@ "use strict"; | ||
prepend: [...visitor.getImports()], | ||
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'), | ||
content: [].join('\n'), | ||
}; | ||
@@ -59,0 +54,0 @@ } |
{ | ||
"name": "@acrool/graphql-codegen-apollo-subscription", | ||
"version": "3.0.1-test.3", | ||
"version": "3.0.1-test.4", | ||
"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
42105
572