apollo-compiler@1.0.0-beta.19
1.0.0-beta.19 - 2024-07-19
BREAKING
-
Remove deprecated
Name
reexports - SimonSapin in pull/877.
apollo_compiler::Name
should now be imported instead of:apollo_compiler::ast::Name
apollo_compiler::schema::Name
apollo_compiler::executable::Name
These other paths emitted deprecation warnings in 1.0.0-beta.18 and are now removed.
-
Move operations of an
ExecutableDocument
into a new struct - SimonSapin in pull/879.doc.anonymous_operation
→doc.operations.anonymous
doc.named_operations
→doc.operations.named
doc.get_operation()
→doc.operations.get()
doc.get_operation_mut()
→doc.operations.get_mut()
doc.insert_operation()
→doc.operations.insert()
doc.all_operations()
→doc.operations.iter()
This change makesget_mut()
borrow onlydoc.operations
instead of the entire document, making it possible to also mutatedoc.fragments
during that mutable borrow.
-
Move or rename some import paths - SimonSapin in pull/885. Moved from the crate root to the new(ly public)
apollo_compiler::parser
module:Parser
SourceFile
SourceMap
FileId
Moved to the
parser
module and renamed:NodeLocation
→SourceSpan
GraphQLLocation
→LineColumn
-
Return ranges of line/column locations - dylan-apollo in pull/861.
SourceSpan
contains a file ID and a range of UTF-8 offsets within that file. Various APIs can convert offsets to line and column numbers, but often only considered the start offset. They are now changed to consider the range of start and end positions.Added, returning
Option<Range<LineColumn>>
:SourceSpan::line_column_range
Diagnostic::line_column_range
Name::line_column_range
Removed:
LineColumn::from_node
Diagnostic::get_line_column
SourceFile::get_line_column
-
Use a fast hasher - o0Ignition0o in pull/881. Configured all hash-based collections used in apollo-compiler to use
ahash
, which is faster than the default standard library hasher.apollo_compiler::collections
provides type aliases for collections configured with the same hasher as collections in various parts of the public API.
Features
- Add a few helper methods - SimonSapin in pull/885:
executable::OperationMap::from_one
schema::SchemaDefinition::iter_root_operations()
schema::ExtendedType::is_leaf
Fixes
- Fix potential hash collision bug in validation - goto-bus-stop in pull/878
- Fix validation for undefined variables nested in values - goto-bus-stop in pull/885