apollographql / apollo-rs

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

Remove ariadne byte/char mapping #857

Closed goto-bus-stop closed 4 months ago

goto-bus-stop commented 4 months ago

ariadne 0.4.1 supports using byte indices directly. This patch removes MappedSource, saving some computation but mostly memory usage when generating JSON or CLI reports for diagnostics.

We could also use NodeLocation as an ariadne span directly by implementing the Span trait for it. It's a little more convenient when creating the reports. I opted not to do that because it's user-visible if users install ariadne manually, instead I kept the internal conversion to a (FileId, Range<u64>) span.