Skip to content

Pass down ast.Path of current field, argument etc.. inside validator.Events.OnField  #332

@shotmk

Description

@shotmk

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions