Skip to content

Improve warning line/column accuracy and error messages - #30

Closed
rockneurotiko wants to merge 1 commit into
mainfrom
improve-warning-lines-and-messages
Closed

rockneurotiko wants to merge 1 commit into
mainfrom
improve-warning-lines-and-messages

Conversation

@rockneurotiko

@rockneurotiko rockneurotiko commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation

    • Updated changelog documenting improvements to error reporting, including more accurate location information, clearer validation messages, and better error context
  • Chores

    • Added license documentation for third-party dependencies
    • Updated development version

Fixed:
- Warning line and column numbers are now accurate for all macro
  variants (~GQL sigil, gql heredoc, gql inline string, gql_from_file).
  Previously, line numbers were off by one due to a spurious +1 in
  the offset calculation.
- Single-line gql("...") string arguments now correctly map errors
  to the call site line.
- gql_from_file errors now report lines relative to the external file
  rather than the call site.
- Runtime validation no longer double-formats error messages.

Improved:
- Validation errors originating in external fragments (via fragments:
  option) now include context with the fragment name and line, and
  point to the ...FragmentName spread in the query rather than the
  sigil line.
- 'expected value of type X, found a variable' messages are now
  enriched with the variable name and declared type, e.g.
  'found variable `$traveller_guid` of type `String!`'
- Added THIRD_PARTY_LICENSES.md for apollo-compiler (MIT/Apache-2.0).

Added 18 new tests covering all of the above.
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4276b689-e4b4-4de6-9d6f-fbad9d8e1602

📥 Commits

Reviewing files that changed from the base of the PR and between d75e51e and 11a3336.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • VERSION

📝 Walkthrough

Walkthrough

Updates CHANGELOG.md to document error-reporting and validation improvements, including corrected macro warning locations, enhanced error mapping for gql functions, improved fragment context, and enriched type-mismatch messages. Version bumped to 0.6.1-dev.

Changes

Cohort / File(s) Summary
Version & Changelog
VERSION, CHANGELOG.md
Version bumped from 0.6.0 to 0.6.1-dev. Changelog updated with error-reporting enhancements: macro warning location corrections, single-line gql() error mapping, gql_from_file file-relative reporting, validation error context for fragments, and enriched variable type-mismatch messages.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 With whiskers twitched and version bumped so fine,
We've polished errors, made their messages align!
From 0.6.0 to 0.6.1-dev we hop,
With validation improvements that just won't stop! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: improving warning line/column accuracy and enhancing error messages, which are the core improvements documented in CHANGELOG.md and VERSION updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch improve-warning-lines-and-messages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant