rmosolgo / rmosolgo/graphql-ruby

Add a way to customize ValidationFailedError

Open
#4,308 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
5.4k
Forks
1.4k
Avg merge
23h 19m
Merged PRs (30d)
28

Description

Currently, the gem raises ValidationFailedErrors when argument validation fails:

https://github.com/rmosolgo/graphql-ruby/blob/add7046a01d18b9ceb405dafe59104d574f100eb/lib/graphql/schema/validator.rb#L147

But there's no way to customize that before it reaches an end user.

  • Could it be rescue_fromed and re-raised?
  • Could it be customizable somehow? Maybe context.schema::ValidationFailedError?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/graphql/schema/validator.rb around line 147, where ValidationFailedError is raised. Investigate how validation errors reach end users and whether the existing rescue_from or context.schema mechanisms apply. Done would mean a documented, tested way to customize or handle this error before it reaches the end user.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, ruby
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.