Skip to content

Validation errors should include a path #102

Open
@rgraff

Description

@rgraff

Is your feature request related to a problem? Please describe.

Validation errors include a fields list that is snakecase, but should instead include a path that is camelCase.

Given a mutation like this:

mutation {
  addOverride(input: {  override: { variantKey: $variantKey}}) { ... }
}

if your variantKey is invalid (InvalidArgument), you'll get a response like this:

%{"data" => %{"addOverride" => %{"errors" => [%{"code" => "invalid_argument", "fields" => ["variant_key"], "message" => "variant key not found"}], "result" => nil}}}

Describe the solution you'd like

You'll want a response like this with path and camelCase

%{"data" => %{"addOverride" => %{"errors" => [%{"code" => "invalid_argument", "path" => ["input", "override", "variantKey"], "message" => "variant key not found"}], "result" => nil}}}

Additional context
I'm unfamiliar with the graphql spec and conventions, there may be a standard here that I'm unaware of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions