-
Notifications
You must be signed in to change notification settings - Fork 123
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
introduce ast.Path type #117
Conversation
case PathIndex: | ||
str.WriteString(fmt.Sprintf("[%d]", v)) | ||
case PathName: | ||
if i != 0 { |
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.
bug if path starts with number?
eg .[0].foo.bar
?
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.
expected is [0].foo.bar
? 🤔
I think number is not coming at head of path.
so, this PR can't validate element value.
- don't place number at head
- don't contains
nil
value
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.
Textbook use case for Discriminated Unions :(
LGTM
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.
Actually, can we check how bad the bc break is here?
Will the old code fail at runtime only? If so I dont think we should ship this
@vektah 99designs/gqlgen#1022 I tried to apply this patch to gqlgen.
New code is developer-friendly. prevention of runtime errors may be small 🤔 |
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.
@vektah thanks! please ping me when add new tags for this repo. I'll update gqlgen side. |
example about apply vektah/gqlparser#117
example about apply vektah/gqlparser#117
this is a Breaking Change.
but I think it's better to do it before gqlgen becomes 1.0.0.
Motivation.
[]interface{}
is unclear typing.I read source code that what's contains in Path values often.
and, I want to use string format path value.
It uses for collect gqlgen metrics & logs to OpenCensus / Stackdriver Logging.