You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Throw when a resolver method is missing a parameter for an argument in 15.0.0 #889
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:
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
changed the title [-]Throw when an argument is bound to a context parameter in 15.0.0[/-][+]Throw when a resolver method is missing a parameter for an argument in 15.0.0[/+]on Oct 19, 2026
Activity
[-]Throw when an argument is bound to a context parameter in 15.0.0[/-][+]Throw when a resolver method is missing a parameter for an argument in 15.0.0[/+]