@pothos/plugin-directives
Advanced tools
Comparing version 4.0.1 to 4.1.0
# Change Log | ||
## 4.1.0 | ||
### Minor Changes | ||
- 27af377: replace eslint and prettier with biome | ||
## 4.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { EnumValues, FieldNullability, FieldRequiredness, InputFieldMap, InputType, InterfaceParam, ObjectParam, RootName, SchemaTypes, TypeParam } from '@pothos/core'; | ||
import { DirectiveLocation, Directives } from './types'; | ||
import type { EnumValues, FieldNullability, FieldRequiredness, InputFieldMap, InputType, InterfaceParam, ObjectParam, RootName, SchemaTypes, TypeParam } from '@pothos/core'; | ||
import type { DirectiveLocation, Directives } from './types'; | ||
import type { PothosDirectivesPlugin } from '.'; | ||
@@ -4,0 +4,0 @@ declare global { |
import './global-types'; | ||
import { GraphQLSchema } from 'graphql'; | ||
import { BasePlugin, PothosEnumValueConfig, PothosInputFieldConfig, PothosOutputFieldConfig, PothosTypeConfig, SchemaTypes } from '@pothos/core'; | ||
import { DirectiveList } from './types'; | ||
import { BasePlugin, type PothosEnumValueConfig, type PothosInputFieldConfig, type PothosOutputFieldConfig, type PothosTypeConfig, type SchemaTypes } from '@pothos/core'; | ||
import type { GraphQLSchema } from 'graphql'; | ||
import type { DirectiveList } from './types'; | ||
export * from './types'; | ||
@@ -14,5 +14,5 @@ declare const pluginName = "directives"; | ||
afterBuild(schema: GraphQLSchema): GraphQLSchema; | ||
mergeDirectives(left: DirectiveList | Record<string, {}>, right: DirectiveList | Record<string, {}>): DirectiveList | Record<string, {}>; | ||
normalizeDirectives(directives: DirectiveList | Record<string, {}>): DirectiveList | Record<string, {}>; | ||
mergeDirectives(left: DirectiveList | Record<string, object>, right: DirectiveList | Record<string, object>): DirectiveList | Record<string, object>; | ||
normalizeDirectives(directives: DirectiveList | Record<string, object>): DirectiveList | Record<string, object>; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
import './global-types'; | ||
import { GraphQLSchema } from 'graphql'; | ||
import { type GraphQLSchema } from 'graphql'; | ||
export default function mockAst(schema: GraphQLSchema): void; | ||
//# sourceMappingURL=mock-ast.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '@pothos/core'; | ||
import type { SchemaTypes } from '@pothos/core'; | ||
export type DirectiveLocation = 'ARGUMENT_DEFINITION' | 'ENUM_VALUE' | 'ENUM' | 'FIELD_DEFINITION' | 'INPUT_FIELD_DEFINITION' | 'INPUT_OBJECT' | 'INTERFACE' | 'OBJECT' | 'SCALAR' | 'SCHEMA' | 'UNION'; | ||
export type DirectiveList = { | ||
name: string; | ||
args?: {}; | ||
args?: object; | ||
}[]; | ||
@@ -7,0 +7,0 @@ export type DirectivesFor<Types extends SchemaTypes, Location extends DirectiveLocation> = { |
@@ -1,3 +0,3 @@ | ||
import { EnumValues, FieldNullability, FieldRequiredness, InputFieldMap, InputType, InterfaceParam, ObjectParam, RootName, SchemaTypes, TypeParam } from '@pothos/core'; | ||
import { DirectiveLocation, Directives } from './types.js'; | ||
import type { EnumValues, FieldNullability, FieldRequiredness, InputFieldMap, InputType, InterfaceParam, ObjectParam, RootName, SchemaTypes, TypeParam } from '@pothos/core'; | ||
import type { DirectiveLocation, Directives } from './types.js'; | ||
import type { PothosDirectivesPlugin } from './index.js'; | ||
@@ -4,0 +4,0 @@ declare global { |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ export {}; | ||
export {}; | ||
//# sourceMappingURL=global-types.js.map |
import './global-types.js'; | ||
import { GraphQLSchema } from 'graphql'; | ||
import { BasePlugin, PothosEnumValueConfig, PothosInputFieldConfig, PothosOutputFieldConfig, PothosTypeConfig, SchemaTypes } from '@pothos/core'; | ||
import { DirectiveList } from './types.js'; | ||
import { BasePlugin, type PothosEnumValueConfig, type PothosInputFieldConfig, type PothosOutputFieldConfig, type PothosTypeConfig, type SchemaTypes } from '@pothos/core'; | ||
import type { GraphQLSchema } from 'graphql'; | ||
import type { DirectiveList } from './types.js'; | ||
export * from './types.js'; | ||
@@ -14,5 +14,5 @@ declare const pluginName = "directives"; | ||
afterBuild(schema: GraphQLSchema): GraphQLSchema; | ||
mergeDirectives(left: DirectiveList | Record<string, {}>, right: DirectiveList | Record<string, {}>): DirectiveList | Record<string, {}>; | ||
normalizeDirectives(directives: DirectiveList | Record<string, {}>): DirectiveList | Record<string, {}>; | ||
mergeDirectives(left: DirectiveList | Record<string, object>, right: DirectiveList | Record<string, object>): DirectiveList | Record<string, object>; | ||
normalizeDirectives(directives: DirectiveList | Record<string, object>): DirectiveList | Record<string, object>; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable no-param-reassign */ import './global-types.js'; | ||
import './global-types.js'; | ||
import SchemaBuilder, { BasePlugin } from '@pothos/core'; | ||
@@ -3,0 +3,0 @@ import mockAst from './mock-ast.js'; |
import './global-types.js'; | ||
import { GraphQLSchema } from 'graphql'; | ||
import { type GraphQLSchema } from 'graphql'; | ||
export default function mockAst(schema: GraphQLSchema): void; | ||
//# sourceMappingURL=mock-ast.d.ts.map |
@@ -1,3 +0,3 @@ | ||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ /* eslint-disable no-param-reassign */ import './global-types.js'; | ||
import { astFromValue, GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, Kind, parseValue } from 'graphql'; | ||
import './global-types.js'; | ||
import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, Kind, astFromValue, parseValue } from 'graphql'; | ||
export default function mockAst(schema) { | ||
@@ -36,3 +36,3 @@ var _schema_extensions; | ||
]; | ||
Object.keys(types).forEach((typeName) => { | ||
for (const typeName of Object.keys(types)) { | ||
const type = types[typeName]; | ||
@@ -136,3 +136,3 @@ if (type instanceof GraphQLObjectType) { | ||
} | ||
}); | ||
} | ||
} | ||
@@ -139,0 +139,0 @@ function typeNode(type) { |
@@ -1,6 +0,6 @@ | ||
import { SchemaTypes } from '@pothos/core'; | ||
import type { SchemaTypes } from '@pothos/core'; | ||
export type DirectiveLocation = "ARGUMENT_DEFINITION" | "ENUM_VALUE" | "ENUM" | "FIELD_DEFINITION" | "INPUT_FIELD_DEFINITION" | "INPUT_OBJECT" | "INTERFACE" | "OBJECT" | "SCALAR" | "SCHEMA" | "UNION"; | ||
export type DirectiveList = { | ||
name: string; | ||
args?: {}; | ||
args?: object; | ||
}[]; | ||
@@ -7,0 +7,0 @@ export type DirectivesFor<Types extends SchemaTypes, Location extends DirectiveLocation> = { |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ "use strict"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -3,0 +3,0 @@ value: true |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable no-param-reassign */ "use strict"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -3,0 +3,0 @@ value: true |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ /* eslint-disable no-param-reassign */ "use strict"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -46,3 +46,3 @@ value: true | ||
]; | ||
Object.keys(types).forEach((typeName)=>{ | ||
for (const typeName of Object.keys(types)){ | ||
const type = types[typeName]; | ||
@@ -141,3 +141,3 @@ if (type instanceof _graphql.GraphQLObjectType) { | ||
} | ||
}); | ||
} | ||
} | ||
@@ -144,0 +144,0 @@ function typeNode(type) { |
{ | ||
"name": "@pothos/plugin-directives", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "Directive plugin for Pothos, enables using graphql-tools based directives with Pothos", | ||
@@ -42,3 +42,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@graphql-tools/utils": "^10.3.1", | ||
"@graphql-tools/utils": "^10.3.2", | ||
"graphql": "^16.8.1", | ||
@@ -48,4 +48,4 @@ "graphql-rate-limit-directive": "^2.0.5", | ||
"rate-limiter-flexible": "^5.0.3", | ||
"@pothos/core": "4.0.2", | ||
"@pothos/test-utils": "2.0.1" | ||
"@pothos/core": "4.1.0", | ||
"@pothos/test-utils": "2.1.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "gitHead": "9dfe52f1975f41a111e01bf96a20033a914e2acc", |
@@ -1,3 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { | ||
import type { | ||
EnumValues, | ||
@@ -14,3 +13,3 @@ FieldNullability, | ||
} from '@pothos/core'; | ||
import { DirectiveLocation, Directives } from './types'; | ||
import type { DirectiveLocation, Directives } from './types'; | ||
@@ -17,0 +16,0 @@ import type { PothosDirectivesPlugin } from '.'; |
@@ -1,14 +0,13 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import './global-types'; | ||
import { GraphQLSchema } from 'graphql'; | ||
import SchemaBuilder, { | ||
BasePlugin, | ||
PothosEnumValueConfig, | ||
PothosInputFieldConfig, | ||
PothosOutputFieldConfig, | ||
PothosTypeConfig, | ||
SchemaTypes, | ||
type PothosEnumValueConfig, | ||
type PothosInputFieldConfig, | ||
type PothosOutputFieldConfig, | ||
type PothosTypeConfig, | ||
type SchemaTypes, | ||
} from '@pothos/core'; | ||
import type { GraphQLSchema } from 'graphql'; | ||
import mockAst from './mock-ast'; | ||
import { DirectiveList } from './types'; | ||
import type { DirectiveList } from './types'; | ||
@@ -34,4 +33,4 @@ export * from './types'; | ||
this.mergeDirectives( | ||
fieldConfig.extensions?.directives as Record<string, {}>, | ||
options.directives as unknown as Record<string, {}>, | ||
fieldConfig.extensions?.directives as Record<string, object>, | ||
options.directives as unknown as Record<string, object>, | ||
), | ||
@@ -56,4 +55,4 @@ ), | ||
this.mergeDirectives( | ||
fieldConfig.extensions?.directives as Record<string, {}>, | ||
options.directives as unknown as Record<string, {}>, | ||
fieldConfig.extensions?.directives as Record<string, object>, | ||
options.directives as unknown as Record<string, object>, | ||
), | ||
@@ -78,4 +77,4 @@ ), | ||
this.mergeDirectives( | ||
valueConfig.extensions?.directives as Record<string, {}>, | ||
options.directives as unknown as Record<string, {}>, | ||
valueConfig.extensions?.directives as Record<string, object>, | ||
options.directives as unknown as Record<string, object>, | ||
), | ||
@@ -100,4 +99,4 @@ ), | ||
this.mergeDirectives( | ||
typeConfig.extensions?.directives as Record<string, {}>, | ||
options.directives as unknown as Record<string, {}>, | ||
typeConfig.extensions?.directives as Record<string, object>, | ||
options.directives as unknown as Record<string, object>, | ||
), | ||
@@ -114,4 +113,4 @@ ), | ||
this.mergeDirectives( | ||
(schema.extensions?.directives as Record<string, {}>) ?? {}, | ||
this.options.schemaDirectives as unknown as Record<string, {}>, | ||
(schema.extensions?.directives as Record<string, object>) ?? {}, | ||
this.options.schemaDirectives as unknown as Record<string, object>, | ||
), | ||
@@ -127,4 +126,4 @@ ), | ||
mergeDirectives( | ||
left: DirectiveList | Record<string, {}>, | ||
right: DirectiveList | Record<string, {}>, | ||
left: DirectiveList | Record<string, object>, | ||
right: DirectiveList | Record<string, object>, | ||
) { | ||
@@ -145,3 +144,3 @@ if (!(left && right)) { | ||
normalizeDirectives(directives: DirectiveList | Record<string, {}>) { | ||
normalizeDirectives(directives: DirectiveList | Record<string, object>) { | ||
if (this.builder.options.directives?.useGraphQLToolsUnorderedDirectives) { | ||
@@ -148,0 +147,0 @@ if (!Array.isArray(directives)) { |
@@ -1,20 +0,16 @@ | ||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ | ||
/* eslint-disable no-param-reassign */ | ||
import './global-types'; | ||
import { | ||
ArgumentNode, | ||
astFromValue, | ||
ConstDirectiveNode, | ||
ConstValueNode, | ||
DirectiveNode, | ||
EnumValueDefinitionNode, | ||
FieldDefinitionNode, | ||
GraphQLArgument, | ||
type ArgumentNode, | ||
type ConstDirectiveNode, | ||
type ConstValueNode, | ||
type DirectiveNode, | ||
type EnumValueDefinitionNode, | ||
type FieldDefinitionNode, | ||
type GraphQLArgument, | ||
GraphQLEnumType, | ||
GraphQLEnumValue, | ||
GraphQLField, | ||
GraphQLFieldMap, | ||
GraphQLInputField, | ||
GraphQLInputFieldMap, | ||
type GraphQLEnumValue, | ||
type GraphQLField, | ||
type GraphQLFieldMap, | ||
type GraphQLInputField, | ||
type GraphQLInputFieldMap, | ||
GraphQLInputObjectType, | ||
@@ -26,13 +22,14 @@ GraphQLInterfaceType, | ||
GraphQLScalarType, | ||
GraphQLSchema, | ||
GraphQLType, | ||
type GraphQLSchema, | ||
type GraphQLType, | ||
GraphQLUnionType, | ||
InputValueDefinitionNode, | ||
type InputValueDefinitionNode, | ||
Kind, | ||
ListTypeNode, | ||
NamedTypeNode, | ||
OperationTypeNode, | ||
type ListTypeNode, | ||
type NamedTypeNode, | ||
type OperationTypeNode, | ||
type TypeNode, | ||
type ValueNode, | ||
astFromValue, | ||
parseValue, | ||
TypeNode, | ||
ValueNode, | ||
} from 'graphql'; | ||
@@ -76,3 +73,3 @@ import type { DirectiveList } from './types'; | ||
Object.keys(types).forEach((typeName) => { | ||
for (const typeName of Object.keys(types)) { | ||
const type = types[typeName]; | ||
@@ -130,3 +127,3 @@ | ||
} | ||
}); | ||
} | ||
} | ||
@@ -174,3 +171,3 @@ | ||
function directiveNodes( | ||
directives: DirectiveList | Record<string, {}> | undefined, | ||
directives: DirectiveList | Record<string, object> | undefined, | ||
deprecationReason?: string | null, | ||
@@ -186,3 +183,3 @@ ): readonly ConstDirectiveNode[] { | ||
Array.isArray(directives[name]) | ||
? (directives[name] as {}[]).map((args) => ({ | ||
? (directives[name] as object[]).map((args) => ({ | ||
name, | ||
@@ -189,0 +186,0 @@ args, |
@@ -1,2 +0,2 @@ | ||
import { SchemaTypes } from '@pothos/core'; | ||
import type { SchemaTypes } from '@pothos/core'; | ||
@@ -16,3 +16,3 @@ export type DirectiveLocation = | ||
export type DirectiveList = { name: string; args?: {} }[]; | ||
export type DirectiveList = { name: string; args?: object }[]; | ||
@@ -19,0 +19,0 @@ export type DirectivesFor<Types extends SchemaTypes, Location extends DirectiveLocation> = { |
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
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
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
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
124517
1721