graphql-rust / juniper

GraphQL server library for Rust
Other
5.69k stars 422 forks source link

Spanned arguments #1209

Closed audunhalland closed 11 months ago

audunhalland commented 11 months ago

Continued from #1206

This change improves diagnostics when performing manual/domain-specific post-validation of arguments using LookAheadArguments. In the case of an error, the produced error message may be able to refer to the exact position in the problematic GraphQL arguments.

On an unrelated note, I noticed LookAheadArgument does a deep/greedy transform of the InputValue to perform variable substitution. A potential improvement to this is to only do this lazily for each expansion step, i.e. the LookAheadArgument privately keeps a reference to its InputValue and the variable table and somehow exposes a LookAhead interface on top of this.