Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions types/graphql/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Ivan Goncharov <https://github.com/IvanGoncharov>
// Hagai Cohen <https://github.com/DxCx>
// Ricardo Portugal <https://github.com/rportugal>
// Tim Griesser <https://github.com/tgriesser>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

Expand Down
16 changes: 8 additions & 8 deletions types/graphql/type/definition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ export type GraphQLIsTypeOfFn<TSource, TContext> = (
info: GraphQLResolveInfo
) => boolean | Promise<boolean>;

export type GraphQLFieldResolver<TSource, TContext> = (
export type GraphQLFieldResolver<TSource, TContext, TArgs = { [argName: string]: any }> = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgriesser In graphql-js it described as following

export type GraphQLFieldResolver<TSource, TContext> = (

https://github.com/graphql/graphql-js/blob/master/src/type/definition.js#L717

I strongly believe that TS typings should be in sync with official Flow typings.
Please consider contributing your changes to graphql-js first.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool will do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source: TSource,
args: { [argName: string]: any },
args: TArgs,
context: TContext,
info: GraphQLResolveInfo
) => any;
Expand All @@ -284,11 +284,11 @@ export interface GraphQLResolveInfo {

export type ResponsePath = { prev: ResponsePath, key: string | number } | undefined;

export interface GraphQLFieldConfig<TSource, TContext> {
export interface GraphQLFieldConfig<TSource, TContext, TArgs = { [argName: string]: any }> {
type: GraphQLOutputType;
args?: GraphQLFieldConfigArgumentMap;
resolve?: GraphQLFieldResolver<TSource, TContext>;
subscribe?: GraphQLFieldResolver<TSource, TContext>;
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
deprecationReason?: string;
description?: string;
astNode?: FieldDefinitionNode;
Expand All @@ -309,13 +309,13 @@ export interface GraphQLFieldConfigMap<TSource, TContext> {
[fieldName: string]: GraphQLFieldConfig<TSource, TContext>;
}

export interface GraphQLField<TSource, TContext> {
export interface GraphQLField<TSource, TContext, TArgs = { [argName: string]: any }> {
name: string;
description: string;
type: GraphQLOutputType;
args: GraphQLArgument[];
resolve?: GraphQLFieldResolver<TSource, TContext>;
subscribe?: GraphQLFieldResolver<TSource, TContext>;
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
isDeprecated?: boolean;
deprecationReason?: string;
astNode?: FieldDefinitionNode;
Expand Down