apollographql / apollo-rs

Spec compliant GraphQL Tools in Rust.
Apache License 2.0
566 stars 45 forks source link

chore(compiler): port compiler validation errors to new diagnostics API #776

Closed goto-bus-stop closed 9 months ago

goto-bus-stop commented 9 months ago

Based on #747, separated out to make that PR easier to read

Closes #756, closes #691

Ports compiler-based validation from the ApolloDiagnostic builder type to a simpler error ValidationError. The validation::diagnostics::{ValidationError, DiagnosticData} types have the same structure as the validation::{DiagnosticData, Details} types, so it can be flattened easily, inlining all build errors and validation errors. That could even be done in this PR 🤔

Improved some error messages while there, so the main message names relevant types, and they still make sense without additional labels.

Todo: