-
Notifications
You must be signed in to change notification settings - Fork 428
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
Spanned arguments #1206
Spanned arguments #1206
Conversation
A change that could be done to improve this is to somehow borrow the (start, end) tuple in Edit: I propose a redesigned Spanning like this: struct Spanning<T> {
pub item: T,
pub span: Span
}
struct Span {
pub start: SourcePosition,
pub end: SourcePosition,
} |
a11eeeb
to
403b029
Compare
@audunhalland could you provide some meaningful examples where do you want this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@audunhalland could you provide some meaningful examples where do you want this?
Giving it a little bit more thoughts, I now better understand how this may be useful, and overall okay with this course of changes.
Edit: I propose a redesigned Spanning like this:
struct Spanning<T> { pub item: T, pub span: Span } struct Span { pub start: SourcePosition, pub end: SourcePosition, }
Yup, that would be better.
@tyranron thank you for the review! I think the Spanning redesign should be a separate PR and I'll instead rebase this one. |
That PR is up at #1207 |
I'll close this PR and open a new one on top of #1208 later. |
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.I figure this breaking change can be seriously considered, as Juniper looks set for a breaking release anyway.