Skip to content

Releases: apollographql/apollo-rs

apollo-parser@0.8.1

20 Aug 14:28
55002fd
Compare
Choose a tag to compare

0.8.1 - 2024-08-20

Features

This makes it easier for pretty-printers, linters and the like to work with the
parser API.

apollo-smith@0.10.0

31 Jul 10:33
b510f48
Compare
Choose a tag to compare
  • Update apollo-parser dependency to 0.8.0
  • Update apollo-compiler dependency to =1.0.0-beta.20

apollo-parser@0.8.0

31 Jul 08:45
b37fec8
Compare
Choose a tag to compare

BREAKING

This release removes the Error::new constructor. We recommend not creating instances of
apollo_parser::Error yourself at all.

Fixes

  • add missing location information for lexer errors - PhoebeSzmucer, pull/886, issue/731
    Unexpected characters now raise an error pointing to the character itself, instead of the start of the input document.

apollo-compiler@1.0.0-beta.20

31 Jul 10:34
3df1e62
Compare
Choose a tag to compare

Fixes

  • Fix variable validation in operation directives - goto-bus-stop in pull/888.
    • query ($var: Int) @directive(arg: $var) is now accepted - it used to raise an unused variable error for $var.

Maintenance

apollo-compiler@1.0.0-beta.19

19 Jul 18:15
13f4aa1
Compare
Choose a tag to compare

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

apollo-compiler@1.0.0-beta.18

27 Jun 14:23
356b702
Compare
Choose a tag to compare

1.0.0-beta.18 - 2024-06-27

BREAKING

  • Name representation change - SimonSapin in pull/868. The memory representation of GraphQL names is changed to use Arc<str> or &'static str internally, and provide corresponding cheap conversions. This may also help enable string interning in a future compiler version.

    • Name should now be imported from the crate root. The previous paths (apollo_compiler::ast::Name, apollo_compiler::executable::Name, and apollo_compiler::schema::Name) now emit a deprecation warning and will be removed in a later version.
    • NodeStr has been removed, with its functionality folded into Name
    • ast::Value::String now contains a plain String instead of NodeStr. Value itself is in a Node<_> that contains the same source span as NodeStr did.
    • Descriptions are now represented as Option<Node<str>> instead of Option<NodeStr>.
  • Feature REMOVED: Hash cache in Node<T> - SimonSapin in pull/872. Node<T> is a reference-counted smart pointer that provides thread-safe shared ownership for at T value together with an optional source location. In previous beta version of apollo-compiler 1.0 it contained a cache in its Hash implementation: the hash of the T value would be computed once and stored, then Hash for Node<T> would hash that hash code. That functionality is now removed, Hash for Node<T> simply forwards to Hash for T. This reduces each Node heap allocation by 8 bytes, and reduces code complexity.

    Now that apollo-compiler does not use Salsa anymore, Hash is much less central than it used to be. Many types stored in Node<_> don’t implement Hash at all (because they contain an IndexMap which doesn’t either).

    Programs that relied on this cache will still compile. We still consider this change breaking as they’ll need to build their own cache to maintain performance characteristics.

Fixes

  • Fix validation error message for missing subselections - goto-bus-stop in pull/865. It now reports the correct coordinate for the missing subselection.

apollo-smith@0.7.0

20 Jun 11:28
6a4a786
Compare
Choose a tag to compare

0.7.0 - 2024-06-20

Features

  • Improve field variability in Selection Set generation - geal, pull/866.
    This changes the field generation algorithm in apollo-smith to allow more
    variety, because the previous implementation was the previous implementation
    was too biased towards the first field specified in a type. This also adds an
    example to generate a random query from a schema.

apollo-compiler@1.0.0-beta.17

05 Jun 12:27
7b1b5db
Compare
Choose a tag to compare

Fixes

  • Fix validation performance bug - goto-bus-stop in issue/862, pull/863
    Adds a cache in fragment spread validation, fixing a situation where validating a query
    with many fragment spreads against a schema with many interfaces could take multiple
    seconds to validate.

Maintenance

  • Remove ariadne byte/char mapping - goto-bus-stop in pull/855
    Generating JSON or CLI reports for apollo-compiler diagnostics used a translation layer
    between byte offsets and character offsets, which cost some computation and memory
    proportional to the size of the source text. The latest version of ariadne allows us to
    remove this translation.

apollo-compiler@1.0.0-beta.16

05 Jun 12:26
019a5e2
Compare
Choose a tag to compare

This release has no user-facing changes.

Features

  • Add GraphQL validation compatibility API for Apollo Router - goto-bus-stop in pull/853
    Enables large-scale production deployment of apollo-compiler's validation implementation.

apollo-parser@0.7.7

08 Apr 12:07
adbecc8
Compare
Choose a tag to compare

Fixes

  • raise an error for empty field sets - tinnou, pull/845
    It's not legal to write type Object {} with braces but without declaring
    any fields. In the past this was accepted by apollo-parser, now it raises an
    error as required by the spec.