apollo-compiler@1.0.0-beta.19
1.0.0-beta.19 - 2024-07-19
BREAKING
-
Remove deprecated
Namereexports - SimonSapin in pull/877.
apollo_compiler::Nameshould now be imported instead of:apollo_compiler::ast::Nameapollo_compiler::schema::Nameapollo_compiler::executable::Name
These other paths emitted deprecation warnings in 1.0.0-beta.18 and are now removed.
-
Move operations of an
ExecutableDocumentinto a new struct - SimonSapin in pull/879.doc.anonymous_operation→doc.operations.anonymousdoc.named_operations→doc.operations.nameddoc.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.operationsinstead of the entire document, making it possible to also mutatedoc.fragmentsduring 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::parsermodule:ParserSourceFileSourceMapFileId
Moved to the
parsermodule and renamed:NodeLocation→SourceSpanGraphQLLocation→LineColumn
-
Return ranges of line/column locations - dylan-apollo in pull/861.
SourceSpancontains 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_rangeDiagnostic::line_column_rangeName::line_column_range
Removed:
LineColumn::from_nodeDiagnostic::get_line_columnSourceFile::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::collectionsprovides 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_oneschema::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