graphql-codegen-typescript
Advanced tools
Comparing version 0.19.0-alpha.9ce4a2d1 to 0.19.0-alpha.a50faf1a
import { BaseTypesVisitor, ParsedTypesConfig } from 'graphql-codegen-visitor-plugin-common'; | ||
import { TypeScriptPluginConfig } from './index'; | ||
import { FieldDefinitionNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, EnumTypeDefinitionNode, InputValueDefinitionNode } from 'graphql'; | ||
import { FieldDefinitionNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, EnumTypeDefinitionNode } from 'graphql'; | ||
export interface TypeScriptPluginParsedConfig extends ParsedTypesConfig { | ||
@@ -19,4 +19,3 @@ avoidOptionals: boolean; | ||
FieldDefinition(node: FieldDefinitionNode, key?: number | string, parent?: any): string; | ||
InputValueDefinition(node: InputValueDefinitionNode, key?: number | string, parent?: any): string; | ||
EnumTypeDefinition(node: EnumTypeDefinitionNode): string; | ||
} |
@@ -18,3 +18,3 @@ "use strict"; | ||
if (str.startsWith('Maybe')) { | ||
return str.replace(/Maybe<(.*?)>$/, '$1'); | ||
return str.replace(/Maybe<(.*?)>/, '$1'); | ||
} | ||
@@ -42,7 +42,2 @@ return str; | ||
} | ||
InputValueDefinition(node, key, parent) { | ||
const originalFieldNode = parent[key]; | ||
const addOptionalSign = !this.config.avoidOptionals && originalFieldNode.type.kind !== graphql_1.Kind.NON_NULL_TYPE; | ||
return graphql_codegen_visitor_plugin_common_1.indent(`${node.name}${addOptionalSign ? '?' : ''}: ${node.type},`); | ||
} | ||
EnumTypeDefinition(node) { | ||
@@ -49,0 +44,0 @@ if (this.config.enumsAsTypes) { |
import { BaseTypesVisitor, ParsedTypesConfig } from 'graphql-codegen-visitor-plugin-common'; | ||
import { TypeScriptPluginConfig } from './index'; | ||
import { FieldDefinitionNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, EnumTypeDefinitionNode, InputValueDefinitionNode } from 'graphql'; | ||
import { FieldDefinitionNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, EnumTypeDefinitionNode } from 'graphql'; | ||
export interface TypeScriptPluginParsedConfig extends ParsedTypesConfig { | ||
@@ -19,4 +19,3 @@ avoidOptionals: boolean; | ||
FieldDefinition(node: FieldDefinitionNode, key?: number | string, parent?: any): string; | ||
InputValueDefinition(node: InputValueDefinitionNode, key?: number | string, parent?: any): string; | ||
EnumTypeDefinition(node: EnumTypeDefinitionNode): string; | ||
} |
@@ -16,3 +16,3 @@ import { DeclarationBlock, indent, BaseTypesVisitor } from 'graphql-codegen-visitor-plugin-common'; | ||
if (str.startsWith('Maybe')) { | ||
return str.replace(/Maybe<(.*?)>$/, '$1'); | ||
return str.replace(/Maybe<(.*?)>/, '$1'); | ||
} | ||
@@ -40,7 +40,2 @@ return str; | ||
} | ||
InputValueDefinition(node, key, parent) { | ||
const originalFieldNode = parent[key]; | ||
const addOptionalSign = !this.config.avoidOptionals && originalFieldNode.type.kind !== Kind.NON_NULL_TYPE; | ||
return indent(`${node.name}${addOptionalSign ? '?' : ''}: ${node.type},`); | ||
} | ||
EnumTypeDefinition(node) { | ||
@@ -47,0 +42,0 @@ if (this.config.enumsAsTypes) { |
{ | ||
"name": "graphql-codegen-typescript", | ||
"version": "0.19.0-alpha.9ce4a2d1", | ||
"version": "0.19.0-alpha.a50faf1a", | ||
"description": "GraphQL Code Generator plugin for generating TypeScript types", | ||
@@ -12,4 +12,4 @@ "repository": "git@github.com:dotansimha/graphql-code-generator.git", | ||
"dependencies": { | ||
"graphql-codegen-plugin-helpers": "0.19.0-alpha.9ce4a2d1", | ||
"graphql-codegen-visitor-plugin-common": "0.19.0-alpha.9ce4a2d1", | ||
"graphql-codegen-plugin-helpers": "0.19.0-alpha.a50faf1a", | ||
"graphql-codegen-visitor-plugin-common": "0.19.0-alpha.a50faf1a", | ||
"tslib": "1.9.3" | ||
@@ -19,3 +19,3 @@ }, | ||
"graphql": "14.1.1", | ||
"graphql-codegen-testing": "0.19.0-alpha.9ce4a2d1", | ||
"graphql-codegen-testing": "0.19.0-alpha.a50faf1a", | ||
"jest": "24.5.0", | ||
@@ -22,0 +22,0 @@ "ts-jest": "24.0.0", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
37488
490
+ Addedgraphql-codegen-plugin-helpers@0.19.0-alpha.a50faf1a(transitive)
+ Addedgraphql-codegen-visitor-plugin-common@0.19.0-alpha.a50faf1a(transitive)
- Removedgraphql-codegen-plugin-helpers@0.19.0-alpha.9ce4a2d1(transitive)
- Removedgraphql-codegen-visitor-plugin-common@0.19.0-alpha.9ce4a2d1(transitive)
Updatedgraphql-codegen-visitor-plugin-common@0.19.0-alpha.a50faf1a