Skip to content

apollo-compiler@1.0.0-beta.19

Compare
Choose a tag to compare
@SimonSapin SimonSapin released this 19 Jul 18:15
· 62 commits to main since this release
13f4aa1

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_operationdoc.operations.anonymous
    • doc.named_operationsdoc.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 makes get_mut() borrow only doc.operations instead of the entire document, making it possible to also mutate doc.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:

    • NodeLocationSourceSpan
    • GraphQLLocationLineColumn
  • 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