@acrool/graphql-codegen-apollo-subscription
Advanced tools
Comparing version 3.0.1-test.0 to 3.0.1-test.1
@@ -56,8 +56,8 @@ "use strict"; | ||
const docs = [ | ||
{ | ||
document: basicDoc, | ||
}, | ||
// { | ||
// document: basicMutation, | ||
// }, | ||
// { | ||
// document: basicDoc, | ||
// }, | ||
// { | ||
// document: basicMutation, | ||
// }, | ||
]; | ||
@@ -64,0 +64,0 @@ const usedBefore = process.memoryUsage().heapUsed; |
@@ -27,22 +27,26 @@ "use strict"; | ||
generateFetcherImplementaion() { | ||
if (this._mapperQuery.isExternal) { | ||
return (0, visitor_plugin_common_1.buildMapperImport)(this._mapperQuery.source, [ | ||
{ | ||
identifier: this._mapperQuery.type, | ||
asDefault: this._mapperQuery.default, | ||
}, | ||
{ | ||
identifier: this._mapperQueryClient.type, | ||
asDefault: this._mapperQueryClient.isExternal ? this._mapperQueryClient.default : false, | ||
}, | ||
{ | ||
identifier: this._mapperInfiniteQuery.type, | ||
asDefault: this._mapperInfiniteQuery.isExternal ? this._mapperInfiniteQuery.default : false, | ||
}, | ||
{ | ||
identifier: this._mapperMutation.type, | ||
asDefault: this._mapperMutation.isExternal ? this._mapperMutation.default : false, | ||
}, | ||
], this.visitor.config.useTypeImports); | ||
} | ||
// if (this._mapperQuery.isExternal) { | ||
// return buildMapperImport( | ||
// this._mapperQuery.source, | ||
// [ | ||
// { | ||
// identifier: this._mapperQuery.type, | ||
// asDefault: this._mapperQuery.default, | ||
// }, | ||
// { | ||
// identifier: this._mapperQueryClient.type, | ||
// asDefault: this._mapperQueryClient.isExternal ? this._mapperQueryClient.default : false, | ||
// }, | ||
// { | ||
// identifier: this._mapperInfiniteQuery.type, | ||
// asDefault: this._mapperInfiniteQuery.isExternal ? this._mapperInfiniteQuery.default : false, | ||
// }, | ||
// { | ||
// identifier: this._mapperMutation.type, | ||
// asDefault: this._mapperMutation.isExternal ? this._mapperMutation.default : false, | ||
// }, | ||
// ], | ||
// this.visitor.config.useTypeImports, | ||
// ); | ||
// } | ||
return null; | ||
@@ -49,0 +53,0 @@ } |
@@ -11,3 +11,2 @@ "use strict"; | ||
const fetcher_custom_mapper_1 = require("./fetcher-custom-mapper"); | ||
const variables_generator_1 = require("./variables-generator"); | ||
class ReactQueryVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor { | ||
@@ -18,8 +17,4 @@ constructor(schema, fragments, rawConfig, documents) { | ||
errorType: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.errorType, 'unknown'), | ||
exposeDocument: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeDocument, false), | ||
exposeQueryKeys: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeQueryKeys, false), | ||
exposeQueryClientHook: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeQueryClientHook, false), | ||
exposeMutationKeys: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeMutationKeys, false), | ||
exposeDocument: false, | ||
exposeFetcher: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeFetcher, false), | ||
addInfiniteQuery: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.addInfiniteQuery, false), | ||
legacyMode: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.legacyMode, false), | ||
@@ -57,12 +52,2 @@ }); | ||
} | ||
// const hookAndTypeImports = [ | ||
// ...Array.from(this.reactQueryHookIdentifiersInUse), | ||
// 'useQueryClient', | ||
// 'QueryClient', | ||
// 'Updater', | ||
// ...Array.from(this.reactQueryOptionsIdentifiersInUse).map( | ||
// identifier => `${this.config.useTypeImports ? 'type ' : ''}${identifier}`, | ||
// ), | ||
// ]; | ||
const moduleName = this.config.legacyMode ? 'react-query' : '@tanstack/react-query'; | ||
return [ | ||
@@ -107,5 +92,5 @@ ...baseImports, | ||
query.push(this.fetcher.generateSubscriptionHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables)); | ||
if (this.config.exposeMutationKeys) { | ||
query.push((0, variables_generator_1.generateMutationKeyMaker)(node, operationName)); | ||
} | ||
// if (this.config.exposeMutationKeys) { | ||
// query.push(generateMutationKeyMaker(node, operationName)); | ||
// } | ||
return query.join('\n'); | ||
@@ -112,0 +97,0 @@ } |
{ | ||
"name": "@acrool/graphql-codegen-apollo-subscription", | ||
"version": "3.0.1-test.0", | ||
"version": "3.0.1-test.1", | ||
"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
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
42586
582