From 2950e9c28d11fb82802e07cb8f31996c499492ca Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Mon, 7 Jan 2019 12:46:42 -0200 Subject: [PATCH] feat(types): make graphql type parameters not required --- .../graphql-query-complexity/dist/QueryComplexity.d.ts | 2 +- types/graphql-relay/graphql-relay-tests.ts | 4 ++-- types/graphql-relay/index.d.ts | 10 +++++----- types/graphql/type/definition.d.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/graphql-query-complexity/dist/QueryComplexity.d.ts b/types/graphql-query-complexity/dist/QueryComplexity.d.ts index 898e2023bb..d092151f91 100644 --- a/types/graphql-query-complexity/dist/QueryComplexity.d.ts +++ b/types/graphql-query-complexity/dist/QueryComplexity.d.ts @@ -20,7 +20,7 @@ export default class QueryComplexity { onOperationDefinitionEnter(operation: OperationDefinitionNode): void; onOperationDefinitionLeave(): GraphQLError | undefined; nodeComplexity(node: FieldNode | FragmentDefinitionNode | InlineFragmentNode | - OperationDefinitionNode, typeDef: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, complexity?: number): number; + OperationDefinitionNode, typeDef: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, complexity?: number): number; createError(): GraphQLError; getDefaultComplexity(args: object, childScore: number): number; } diff --git a/types/graphql-relay/graphql-relay-tests.ts b/types/graphql-relay/graphql-relay-tests.ts index e490329b65..860fe1075f 100644 --- a/types/graphql-relay/graphql-relay-tests.ts +++ b/types/graphql-relay/graphql-relay-tests.ts @@ -49,8 +49,8 @@ const resolve: GraphQLFieldResolver = (source, args, context, info) => context.flag = "f"; }; const fields: GraphQLFieldConfigMap = {}; -let t: GraphQLObjectType; -let e: GraphQLObjectType; +let t: GraphQLObjectType; +let e: GraphQLObjectType; const def = connectionDefinitions({ connectionFields: fields, edgeFields: fields, diff --git a/types/graphql-relay/index.d.ts b/types/graphql-relay/index.d.ts index 67edfa3df0..a484429ed7 100644 --- a/types/graphql-relay/index.d.ts +++ b/types/graphql-relay/index.d.ts @@ -56,7 +56,7 @@ export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionAr export type ConnectionConfigNodeTypeNullable = | GraphQLScalarType - | GraphQLObjectType + | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType; @@ -75,8 +75,8 @@ export interface ConnectionConfig { } export interface GraphQLConnectionDefinitions { - edgeType: GraphQLObjectType; - connectionType: GraphQLObjectType; + edgeType: GraphQLObjectType; + connectionType: GraphQLObjectType; } /** @@ -256,8 +256,8 @@ export interface GraphQLNodeDefinitions { nodesField: GraphQLFieldConfig; } -export type typeResolverFn = ((any: any) => GraphQLObjectType) | - ((any: any) => Promise); +export type typeResolverFn = ((any: any) => GraphQLObjectType) | + ((any: any) => Promise>); /** * Given a function to map from an ID to an underlying object, and a function diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index a33c81cd3b..42851d2f56 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -342,7 +342,7 @@ export interface GraphQLScalarTypeConfig { * }); * */ -export class GraphQLObjectType { +export class GraphQLObjectType { name: string; description: Maybe; astNode: Maybe;