Skip to content

Conversation

@tyranron
Copy link
Member

@tyranron tyranron commented Dec 4, 2025

Part of #1347

Synopsis

At the moment, juniper is over-restrictive regarding input coercion, rejecting situations that should be allowed.

Example

struct Query;

#[graphql_object]
impl Query {
    fn field(#[graphql(default = "defaultValue")] arg: String) -> String {
        arg
    }
}

And the following GraphQL query

query ($var: String) {
  field(arg: $var)
}

is rejected with validation error Variable "var" of type "String" used in position expecting type "String!", but should be allowed according to spec.

Solution

Revisit validation and execution to fully comply with CoerceVariableValues() and CoerceArgumentValues() algorithms.

Cover all the situations with an extensive test suite.

Checklist

  • Tests are added
  • CHANGELOG is updated

@tyranron tyranron added this to the 0.18.0 milestone Dec 4, 2025
@tyranron tyranron self-assigned this Dec 4, 2025
@tyranron tyranron added enhancement Improvement of existing features or bugfix k::design Related to overall design and/or architecture labels Dec 4, 2025
@tyranron tyranron linked an issue Dec 4, 2025 that may be closed by this pull request
23 tasks
@tyranron tyranron mentioned this pull request Dec 4, 2025
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of existing features or bugfix k::design Related to overall design and/or architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphQL spec September 2025

2 participants