@graphql-codegen/jsdoc
Advanced tools
Comparing version
@@ -35,2 +35,8 @@ 'use strict'; | ||
}, | ||
InputObjectTypeDefinition: { | ||
leave(node) { | ||
const typedNode = node; | ||
return createDocBlock([`@typedef {Object} ${typedNode.name}`, ...typedNode.fields]); | ||
}, | ||
}, | ||
InterfaceTypeDefinition: { | ||
@@ -82,2 +88,14 @@ leave(node) { | ||
}, | ||
InputValueDefinition: { | ||
enter(node) { | ||
if (node.type.kind === 'NonNullType') { | ||
return { ...node, nonNullable: true }; | ||
} | ||
return node; | ||
}, | ||
leave(node) { | ||
const fieldName = node.nonNullable ? node.name : `[${node.name}]`; | ||
return `@property {${node.type}} ${fieldName}`; | ||
}, | ||
}, | ||
ListType: { | ||
@@ -84,0 +102,0 @@ enter(node) { |
@@ -31,2 +31,8 @@ import { parse, printSchema, concatAST, visit } from 'graphql'; | ||
}, | ||
InputObjectTypeDefinition: { | ||
leave(node) { | ||
const typedNode = node; | ||
return createDocBlock([`@typedef {Object} ${typedNode.name}`, ...typedNode.fields]); | ||
}, | ||
}, | ||
InterfaceTypeDefinition: { | ||
@@ -78,2 +84,14 @@ leave(node) { | ||
}, | ||
InputValueDefinition: { | ||
enter(node) { | ||
if (node.type.kind === 'NonNullType') { | ||
return { ...node, nonNullable: true }; | ||
} | ||
return node; | ||
}, | ||
leave(node) { | ||
const fieldName = node.nonNullable ? node.name : `[${node.name}]`; | ||
return `@property {${node.type}} ${fieldName}`; | ||
}, | ||
}, | ||
ListType: { | ||
@@ -80,0 +98,0 @@ enter(node) { |
{ | ||
"name": "@graphql-codegen/jsdoc", | ||
"version": "1.15.1-alpha-41e93585.0+41e93585", | ||
"version": "1.15.1-alpha-4ca861a4.29+4ca861a4", | ||
"description": "GraphQL Code Generator plugin for generating JSDoc based types for GraphQL queries, mutations, subscriptions and fragments", | ||
@@ -9,4 +9,4 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@graphql-codegen/plugin-helpers": "1.15.1-alpha-41e93585.0+41e93585", | ||
"@graphql-codegen/visitor-plugin-common": "1.15.1-alpha-41e93585.0+41e93585", | ||
"@graphql-codegen/plugin-helpers": "1.15.1-alpha-4ca861a4.29+4ca861a4", | ||
"@graphql-codegen/visitor-plugin-common": "1.15.1-alpha-4ca861a4.29+4ca861a4", | ||
"tslib": "~2.0.0" | ||
@@ -13,0 +13,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
27962
17.22%253
16.59%