Skip to content

GraphQL: Allow specifying Args on GraphQLFieldResolver (optional)#22789

Merged
RyanCavanaugh merged 1 commit intoDefinitelyTyped:masterfrom
tgriesser:graphql-args-GraphQLFieldResolver
Jan 10, 2018
Merged

GraphQL: Allow specifying Args on GraphQLFieldResolver (optional)#22789
RyanCavanaugh merged 1 commit intoDefinitelyTyped:masterfrom
tgriesser:graphql-args-GraphQLFieldResolver

Conversation

@tgriesser
Copy link
Copy Markdown
Contributor

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Jan 9, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jan 9, 2018

@tgriesser Thank you for submitting this PR!

🔔 @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

) => 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.

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Jan 9, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

@tgriesser One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@tgriesser
Copy link
Copy Markdown
Contributor Author

@IvanGoncharov I think this should be good to go now that graphql-js is updated, let me know if you need any changes.

@typescript-bot typescript-bot added Author Approved and removed Awaiting reviewer feedback Revision needed This PR needs code changes before it can be merged. labels Jan 10, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

A definition author has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@RyanCavanaugh RyanCavanaugh merged commit e429830 into DefinitelyTyped:master Jan 10, 2018
@tgriesser tgriesser deleted the graphql-args-GraphQLFieldResolver branch January 10, 2018 23:04
@corydeppen
Copy link
Copy Markdown
Contributor

@tgriesser I continue to be unable to include args in a resolver function without a TS error. Do you have an example of a resolver function taking an arg that doesn't throw a TS error using "noImplicitAny": "true" and "strictFunctionTypes": true (or "strict": true) with TS >= 2.6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants