@graphql-codegen/visitor-plugin-common
Advanced tools
Comparing version 1.0.4 to 1.0.5-alpha-4bc4c4b5.1
@@ -111,5 +111,9 @@ import { ParsedConfig, RawConfig, BaseVisitor } from './base-visitor'; | ||
protected _variablesTransfomer: OperationVariablesToObject; | ||
protected _usedMappers: { | ||
[key: string]: boolean; | ||
}; | ||
constructor(rawConfig: TRawConfig, additionalConfig: TPluginConfig, _schema: GraphQLSchema, defaultScalars?: ScalarsMap); | ||
readonly schema: GraphQLSchema; | ||
readonly defaultMapperType: string; | ||
readonly unusedMappers: string[]; | ||
readonly mappersImports: string[]; | ||
@@ -127,2 +131,3 @@ protected buildMapperImport(source: string, types: string[]): string; | ||
NonNullType(node: NonNullTypeNode): string; | ||
protected markMapperAsUsed(name: string): void; | ||
protected getTypeToUse(name: string, node: { | ||
@@ -129,0 +134,0 @@ name: any; |
@@ -17,2 +17,3 @@ "use strict"; | ||
this._collectedDirectiveResolvers = {}; | ||
this._usedMappers = {}; | ||
autoBind(this); | ||
@@ -27,2 +28,5 @@ this._variablesTransfomer = new variables_to_object_1.OperationVariablesToObject(this.scalars, this.convertName); | ||
} | ||
get unusedMappers() { | ||
return Object.keys(this.config.mappers).filter(name => !this._usedMappers[name]); | ||
} | ||
get mappersImports() { | ||
@@ -145,4 +149,8 @@ const groupedMappers = {}; | ||
} | ||
markMapperAsUsed(name) { | ||
this._usedMappers[name] = true; | ||
} | ||
getTypeToUse(name, node) { | ||
if (this.config.mappers[name]) { | ||
this.markMapperAsUsed(name); | ||
return this.config.mappers[name].type; | ||
@@ -149,0 +157,0 @@ } |
@@ -111,5 +111,9 @@ import { ParsedConfig, RawConfig, BaseVisitor } from './base-visitor'; | ||
protected _variablesTransfomer: OperationVariablesToObject; | ||
protected _usedMappers: { | ||
[key: string]: boolean; | ||
}; | ||
constructor(rawConfig: TRawConfig, additionalConfig: TPluginConfig, _schema: GraphQLSchema, defaultScalars?: ScalarsMap); | ||
readonly schema: GraphQLSchema; | ||
readonly defaultMapperType: string; | ||
readonly unusedMappers: string[]; | ||
readonly mappersImports: string[]; | ||
@@ -127,2 +131,3 @@ protected buildMapperImport(source: string, types: string[]): string; | ||
NonNullType(node: NonNullTypeNode): string; | ||
protected markMapperAsUsed(name: string): void; | ||
protected getTypeToUse(name: string, node: { | ||
@@ -129,0 +134,0 @@ name: any; |
@@ -15,2 +15,3 @@ import { BaseVisitor } from './base-visitor'; | ||
this._collectedDirectiveResolvers = {}; | ||
this._usedMappers = {}; | ||
autoBind(this); | ||
@@ -25,2 +26,5 @@ this._variablesTransfomer = new OperationVariablesToObject(this.scalars, this.convertName); | ||
} | ||
get unusedMappers() { | ||
return Object.keys(this.config.mappers).filter(name => !this._usedMappers[name]); | ||
} | ||
get mappersImports() { | ||
@@ -143,4 +147,8 @@ const groupedMappers = {}; | ||
} | ||
markMapperAsUsed(name) { | ||
this._usedMappers[name] = true; | ||
} | ||
getTypeToUse(name, node) { | ||
if (this.config.mappers[name]) { | ||
this.markMapperAsUsed(name); | ||
return this.config.mappers[name].type; | ||
@@ -147,0 +155,0 @@ } |
{ | ||
"name": "@graphql-codegen/visitor-plugin-common", | ||
"version": "1.0.4", | ||
"version": "1.0.5-alpha-4bc4c4b5.1+4bc4c4b5", | ||
"license": "MIT", | ||
@@ -9,3 +9,3 @@ "scripts": { | ||
"dependencies": { | ||
"@graphql-codegen/plugin-helpers": "1.0.4", | ||
"@graphql-codegen/plugin-helpers": "1.0.5-alpha-4bc4c4b5.1+4bc4c4b5", | ||
"auto-bind": "2.0.0", | ||
@@ -20,3 +20,3 @@ "dependency-graph": "0.8.0", | ||
"devDependencies": { | ||
"@graphql-codegen/testing": "1.0.4", | ||
"@graphql-codegen/testing": "1.0.5-alpha-4bc4c4b5.1+4bc4c4b5", | ||
"@types/graphql": "14.0.7", | ||
@@ -36,3 +36,3 @@ "graphql": "14.1.1", | ||
}, | ||
"gitHead": "55065fafb9bca86768320c079bb0298b7eccb2ec" | ||
"gitHead": "4bc4c4b5df1c86ffae5f52db41d143e8e59161d8" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
246286
3605
2
1
- Removed@graphql-codegen/plugin-helpers@1.0.4(transitive)
- Removedcamel-case@3.0.0(transitive)
- Removedchange-case@3.1.0(transitive)
- Removedcommon-tags@1.8.0(transitive)
- Removedconstant-case@2.0.0(transitive)
- Removeddot-case@2.1.1(transitive)
- Removedheader-case@1.0.1(transitive)
- Removedimport-from@2.1.0(transitive)
- Removedis-lower-case@1.1.3(transitive)
- Removedis-upper-case@1.1.2(transitive)
- Removedlower-case@1.1.4(transitive)
- Removedlower-case-first@1.0.2(transitive)
- Removedno-case@2.3.2(transitive)
- Removedparam-case@2.1.1(transitive)
- Removedpascal-case@2.0.1(transitive)
- Removedpath-case@2.1.1(transitive)
- Removedresolve-from@3.0.0(transitive)
- Removedsentence-case@2.1.1(transitive)
- Removedsnake-case@2.1.0(transitive)
- Removedswap-case@1.1.2(transitive)
- Removedtitle-case@2.1.1(transitive)
- Removedupper-case@1.1.3(transitive)
- Removedupper-case-first@1.1.2(transitive)
Updated@graphql-codegen/plugin-helpers@1.0.5-alpha-4bc4c4b5.1+4bc4c4b5