Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-codegen-typescript

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-codegen-typescript - npm Package Compare versions

Comparing version 0.19.0-alpha.9ce4a2d1 to 0.19.0-alpha.a50faf1a

3

dist/commonjs/visitor.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc