@pothos/plugin-directives
Advanced tools
Comparing version 3.10.0 to 3.10.1
# Change Log | ||
## 3.10.1 | ||
### Patch Changes | ||
- 671a9935: Add ast nodes for defaultalues for args and input fields | ||
## 3.10.0 | ||
@@ -4,0 +10,0 @@ |
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ /* eslint-disable no-param-reassign */ import './global-types.js'; | ||
import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, Kind, parseValue } from 'graphql'; | ||
import { astFromValue, GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, Kind, parseValue } from 'graphql'; | ||
export default function mockAst(schema) { | ||
@@ -247,2 +247,3 @@ var _schema_extensions; | ||
const field = fields[fieldName]; | ||
const defaultValueNode = astFromValue(field.defaultValue, field.type); | ||
field.astNode = { | ||
@@ -259,2 +260,3 @@ kind: Kind.INPUT_VALUE_DEFINITION, | ||
type: typeNode(field.type), | ||
defaultValue: field.defaultValue === undefined ? undefined : defaultValueNode, | ||
directives: directiveNodes((_field_extensions = field.extensions) === null || _field_extensions === void 0 ? void 0 : _field_extensions.directives, field.deprecationReason) | ||
@@ -268,2 +270,3 @@ }; | ||
var _arg_extensions; | ||
const defaultValueNode = astFromValue(arg.defaultValue, arg.type); | ||
arg.astNode = { | ||
@@ -280,2 +283,3 @@ kind: Kind.INPUT_VALUE_DEFINITION, | ||
type: typeNode(arg.type), | ||
defaultValue: arg.defaultValue === undefined ? undefined : defaultValueNode, | ||
directives: directiveNodes((_arg_extensions = arg.extensions) === null || _arg_extensions === void 0 ? void 0 : _arg_extensions.directives, arg.deprecationReason) | ||
@@ -282,0 +286,0 @@ }; |
@@ -250,2 +250,3 @@ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ /* eslint-disable no-param-reassign */ "use strict"; | ||
const field = fields[fieldName]; | ||
const defaultValueNode = (0, _graphql.astFromValue)(field.defaultValue, field.type); | ||
field.astNode = { | ||
@@ -262,2 +263,3 @@ kind: _graphql.Kind.INPUT_VALUE_DEFINITION, | ||
type: typeNode(field.type), | ||
defaultValue: field.defaultValue === undefined ? undefined : defaultValueNode, | ||
directives: directiveNodes((_field_extensions = field.extensions) === null || _field_extensions === void 0 ? void 0 : _field_extensions.directives, field.deprecationReason) | ||
@@ -271,2 +273,3 @@ }; | ||
var _arg_extensions; | ||
const defaultValueNode = (0, _graphql.astFromValue)(arg.defaultValue, arg.type); | ||
arg.astNode = { | ||
@@ -283,2 +286,3 @@ kind: _graphql.Kind.INPUT_VALUE_DEFINITION, | ||
type: typeNode(arg.type), | ||
defaultValue: arg.defaultValue === undefined ? undefined : defaultValueNode, | ||
directives: directiveNodes((_arg_extensions = arg.extensions) === null || _arg_extensions === void 0 ? void 0 : _arg_extensions.directives, arg.deprecationReason) | ||
@@ -285,0 +289,0 @@ }; |
{ | ||
"name": "@pothos/plugin-directives", | ||
"version": "3.10.0", | ||
"version": "3.10.1", | ||
"description": "Directive plugin for Pothos, enables using graphql-tools based directives with Pothos", | ||
@@ -45,3 +45,3 @@ "main": "./lib/index.js", | ||
"rate-limiter-flexible": "^2.4.1", | ||
"@pothos/core": "3.27.0", | ||
"@pothos/core": "3.27.1", | ||
"@pothos/test-utils": "1.4.7" | ||
@@ -48,0 +48,0 @@ }, |
@@ -7,3 +7,5 @@ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ | ||
ArgumentNode, | ||
astFromValue, | ||
ConstDirectiveNode, | ||
ConstValueNode, | ||
DirectiveNode, | ||
@@ -241,2 +243,4 @@ EnumValueDefinitionNode, | ||
const defaultValueNode = astFromValue(field.defaultValue, field.type) as ConstValueNode; | ||
field.astNode = { | ||
@@ -247,2 +251,3 @@ kind: Kind.INPUT_VALUE_DEFINITION, | ||
type: typeNode(field.type), | ||
defaultValue: field.defaultValue === undefined ? undefined : defaultValueNode, | ||
directives: directiveNodes( | ||
@@ -260,2 +265,4 @@ field.extensions?.directives as DirectiveList, | ||
return args.map((arg): InputValueDefinitionNode => { | ||
const defaultValueNode = astFromValue(arg.defaultValue, arg.type) as ConstValueNode; | ||
arg.astNode = { | ||
@@ -266,2 +273,3 @@ kind: Kind.INPUT_VALUE_DEFINITION, | ||
type: typeNode(arg.type), | ||
defaultValue: arg.defaultValue === undefined ? undefined : defaultValueNode, | ||
directives: directiveNodes( | ||
@@ -268,0 +276,0 @@ arg.extensions?.directives as DirectiveList, |
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
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
122572
1672