Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance schema introspection to report @Argument name mismatch #740

Closed
smilyanovr opened this issue Jun 22, 2023 · 2 comments
Closed

Enhance schema introspection to report @Argument name mismatch #740

smilyanovr opened this issue Jun 22, 2023 · 2 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@smilyanovr
Copy link

smilyanovr commented Jun 22, 2023

Sometimes it is easy to make a mistake with argument names in @QueryMapping methods. This is not reported by schema introspection and error will bubble up on query execution.

Here is a sample schema:

type Query {
    getVehicle(id: ID): Vehicle
}

And this is example controller:

@Controller
class VehicleController {
  
    @QueryMapping
    fun getVehicle(@Argument vehicleId: String) = null
}

@Argument allows to map the argument name internally, though it will be really nice to see such kind of mismatch reported by schema introspection report.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 22, 2023
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 28, 2023
@rstoyanchev rstoyanchev added this to the 1.3 Backlog milestone Jun 28, 2023
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Jun 28, 2023

Sounds like a good one to consider indeed. I think it applies to any @SchemaMapping method, not just queries.

@rstoyanchev rstoyanchev changed the title Enhance schema introspection on query argument mismatch Enhance schema introspection to report @Argument name mismatch Jun 28, 2023
@smilyanovr
Copy link
Author

Correct. It applies also to @SchemaMapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants