Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Throw when a resolver method is missing a parameter for an argument in 15.0.0

Open
#889 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
graphql, kotlin

Research direction

Start in SchemaClassScanner#warnIfParameterMissing and read the existing warning path, then inspect MethodFieldResolverTest for the named test and the 15.0.0 release notes. Replace the warning with a FieldResolverError that preserves its message and verify it is thrown even when either resolver fallback option is enabled. Done when the test asserts the error and the release notes describe the change.

Written by the indexing model from the issue text.

Description

Follow-up to #418 and #890. Tools now warns at build when a resolver method is missing the parameter for an argument and has a DataFetchingEnvironment, GraphQLContext or contextClass parameter instead. The parameter count still matches, so the scanner accepts it and maps the arguments by position:

type Query {
    users(first: Int): UserConnection
}
fun users(env: DataFetchingEnvironment): Connection<User>

Every query of users then fails, with Parameter specified as non-null is null: ... parameter env when first is omitted and Cannot construct instance of graphql.schema.DataFetchingEnvironment when it's sent. The build logs:

Field 'Query.users' has no parameter for its argument 'first: Int' in scenarios.ContextMisboundQuery.users, so the DataFetchingEnvironment parameter gets the argument instead. Add a parameter for each argument, in order, before the DataFetchingEnvironment parameter.

For the contextClass it only warns when the argument is a spec scalar, since the context class can also be a real argument type (e.g. contextClass(Map) with an input object mapped to a Map).

A resolver like this can't work, so it should fail the build. But a schema whose broken field is never queried builds and runs fine today, so throwing has to wait for a major release.

What to change
  • replace the warning in SchemaClassScanner#warnIfParameterMissing with a FieldResolverError that keeps the same message
  • throw it even with allowUnimplementedResolvers or missingResolverDataFetcher set, since the resolver exists but can't be called
  • turn MethodFieldResolverTest."should warn when a resolver method is missing a parameter for an argument" into a test for the error
  • mention it in the 15.0.0 release notes
Dominant language
Kotlin
Stars
824
Forks
175
Avg merge
2d 5h
Merged PRs (30d)
52

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphql-java-kickstart/graphql-java-tools

All issues in graphql-java-kickstart/graphql-java-tools

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.