GraphQL errors have a path field that helps clients to locate the path in graph where error happened.
I am writing some custom directive implementation on top of validator.Walk and validator.Events APIs inside gqlparser.
I was surprised to find out that i do not have access to current field ast.Path inside the OnField() callback.
Looking on a walker implementation it feels like it is pretty easy to calculate path as we are doing a straightforward tree traversal.
Can ast.Path info be added to the OnField Events listener of validator.Events ?
GraphQL errors have a
pathfield that helps clients to locate the path in graph where error happened.I am writing some custom directive implementation on top of
validator.Walkandvalidator.EventsAPIs inside gqlparser.I was surprised to find out that i do not have access to current field
ast.Pathinside the OnField() callback.Looking on a walker implementation it feels like it is pretty easy to calculate path as we are doing a straightforward tree traversal.
Can ast.Path info be added to the
OnFieldEvents listener of validator.Events ?