Skip to content

Releases: apollographql/apollo-rs

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.

apollo-compiler@1.0.0-beta.15

08 Apr 12:08
ef59cee
Compare
Choose a tag to compare

Features

  • Serialize with initial indentation - SimonSapin, pull/848
    This helps use indentation in something that is partly but not entirely GraphQL syntax,
    such as the debugging representation of an Apollo Router query plan.
    Example: document.serialize().initial_indent_level(2).to_string()
  • Add validation requiring composite types declare fields - tinnou, pull/847
    Object types, interfaces, enums, unions, and input objects must all have at least one
    member. This is now checked in schema validation.

apollo-compiler@1.0.0-beta.14 (#841)

15 Mar 09:08
b83199d
Compare
Choose a tag to compare

BREAKING

  • Move NodeLocation and FileId from apollo_compiler::validation to the crate root - SimonSapin, pull/838

Maintenance

  • Remove Salsa database for 1.2× ~ 2× validation speed - SimonSapin, pull/838
    We were not taking advantage of caching it provides.
    Additionally, validation uses Schema and ExecutableDocument directly
    rather than converting them to AST.
    $ cargo bench --bench multi-source
    supergraph parse_and_validate
                          time:   [398.09 µs 399.32 µs 400.82 µs]
                          change: [-19.966% -19.418% -18.864%] (p = 0.00 < 0.05)
                          Performance has improved.
    simple_query parse_and_validate
                          time:   [12.097 µs 12.104 µs 12.113 µs]
                          change: [-52.467% -52.282% -52.109%] (p = 0.00 < 0.05)
                          Performance has improved.
    

apollo-parser@0.7.6

14 Feb 12:42
c46c667
Compare
Choose a tag to compare

Fixes

  • optimize the most common lexer matches into lookup tables - allancalix, pull/814
    Parsing large schema documents can be up to 18% faster, typical documents a few percent.
  • fix infinite loops and crashes found through fuzzing - goto-bus-stop, pull/828
    When using a token limit, it was possible to craft a document that would cause an infinite
    loop, eventually leading to an out of memory crash. This is addressed along with several panics.

Maintenance

apollo-compiler@1.0.0-beta.13

14 Feb 12:45
41b69c2
Compare
Choose a tag to compare

This release includes a critical fix to overflow protection in validation.

Features

  • New field merging validation implementation - goto-bus-stop, pull/816
    • Uses the much more scalable XING algorithm.
    • This also fixes some invalid selections that were previously accepted by apollo-compiler.
    • Selections in fragment definitions are now only validated in the context of the operations they
      are used in, reducing duplicate error reports for invalid fragments. This means invalid unused
      fragments do not produce field merging errors, but they will still raise a different error because
      fragments being unused is also an error according to the spec.
  • Add owned IntoIterator for DirectiveList types - SimonSapin, pull/826

Fixes

  • Actually run RecursionGuard in release mode - SimonSapin, pull/827
    • Due to a debug_assert!() oversight, stack overflow protection in validation did not run
      in release mode.
  • Accept enum values as input for custom scalars - goto-bus-stop, pull/835
    • Custom scalars accept any kind of input value. apollo-compiler used to raise a validation error when
      an enum value was used directly for a custom scalar. However, using an enum value nested inside an
      object or list was accepted. Now enum values are always accepted where a custom scalar is expected.

Maintenance

apollo-compiler@1.0.0-beta.12 (#804)

15 Jan 11:12
523d9ce
Compare
Choose a tag to compare

BREAKING

  • InputValueDefinition::is_required() returns false if it has a default value - goto-bus-stop, pull/798
    • Now argument.is_required() == true only if the type is non-null and there is no
      default value, meaning a value must be provided when it's used.

Features

  • Implement fmt::Display for ComponentName - goto-bus-stop, pull/795
  • Add FieldDefinition::argument_by_name and DirectiveDefinition::argument_by_name - goto-bus-stop, pull/801
    • These methods return an argument definition by name, or None.
  • Add .lookup methods to schema coordinates - goto-bus-stop, pull/803
    • coord!(Type).lookup(&schema) returns the type definition for Type.
    • coord!(Type.field).lookup_field(&schema) returns the field definition for field.
    • coord!(Enum.VALUE).lookup_enum_value(&schema) returns the enum value definition for VALUE.
    • coord!(InputType.field).lookup_input_field(&schema) returns the input field definition for field.
    • coord!(Type.field(argument:)).lookup(&schema) returns the argument definition for argument.
    • coord!(@directive).lookup(&schema) returns the directive definition for @directive.
    • coord!(@directive(argument:)).lookup(&schema) returns the argument definition for argument.
    • string.parse::<SchemaCoordinate>()?.lookup(&schema) returns an enum with all the elements
      that can be looked up using schema coordinates.

Maintenance

  • update ariadne to 0.4.0 - pull/793
    Ariadne is the diagnostic printing crate used for validation errors. v0.4.0 improves memory usage.

apollo-compiler@1.0.0-beta.11

19 Dec 15:56
cb5c096
Compare
Choose a tag to compare

1.0.0-beta.11 - 2023-12-19

This release includes support for GraphQL schema introspection directly in the
compiler
. If this is a feature you're interested in, we encourage you to try it
out and leave us any feedback in the introspection discussion. More details on this feature in the changelog below.

Features

  • Pretty CLI formatting for custom diagnostics - goto-bus-stop, pull/747:
    • A CliReport builder API for printing with labeled source code
      to a monospace text stream with optional ANSI color codes.
    • A ToCliReport trait for converting error types to a CliReport when given a source map.
    • A Diagnostic struct for bundling such an error together with a source map
      and implement Display/Debug by printing a CLI report
  • Add execution-related and introspection functionality - SimonSapin, pull/758:
    • Add data structure in apollo_compiler::execution for a GraphQL response, its data, and errors.
      All (de)serializable with serde.
    • Add coerce_variable_values() in that same module.
    • Add apollo_compiler::execution::SchemaIntrospection
      providing full execution for the schema introspection parts of an operation
      and separating the rest to be executed separately.
      In order to support all kinds of introspection queries this includes
      a full execution engine where users provide objects with resolvable fields.
      At this time this engine is not exposed in the public API.
      If you’re interested in it let us know about your use case!
    • Add ExecutableDocument::insert_operation convenience method.
  • Add NodeStr::from(Name) - goto-bus-stop, pull/773
  • Convenience accessors for ast::Selection enum - SimonSapin, pull/777
    as_field, as_inline_fragment, and as_fragment_spread; all returning Option<&_>.
  • Add schema coordinates - goto-bus-stop, pull/757:
    Schema coordinates are a compact, human-readable way to uniquely point to an item defined in a schema.
    • string.parse::<SchemaCoordinate>() parses a coordinate from a string.
    • Coordinates have a Display impl that writes them out with schema coordinate syntax.
    • The coord!() macro creates a static coordinate at compile time from spec syntax.

Fixes

  • Fix serializing single-line strings with leading whitespace - goto-bus-stop, pull/774
    Previously, the leading whitespace would get lost.

apollo-parser@0.7.5

18 Dec 11:02
21638b7
Compare
Choose a tag to compare

0.7.5 - 2023-12-18

Fixes

  • fix parsing \\""" in block string - goto-bus-stop, pull/774
    Previously this was parsed as \ followed by the end of the string,
    now it's correctly parsed as \ followed by an escaped """.
  • emit syntax errors for variables in constant values - SimonSapin, pull/777
    default values and type system directive arguments are considered constants
    and may not use $foo variable values.
  • emit syntax errors for type condition without a type name rishabh3112, pull/781

apollo-compiler@1.0.0-beta.10

04 Dec 09:34
9d29930
Compare
Choose a tag to compare

1.0.0-beta.10 - 2023-12-04

Features

apollo-smith@0.6.0-beta.1

01 Dec 10:48
1afc623
Compare
Choose a tag to compare

BREAKING

  • Remove the parser-impl feature flag - SimonSapin, pull/754.
    This functionality is now always enabled.
  • Use apollo-compiler instead of apollo-encoder for serialization - SimonSapin, pull/754.
    The exact string output may change.

Fixes

  • Make serialization ordering deterministic - SimonSapin, pull/754.
    Internally use IndexMap and IndexSet instead of IndexMap and IndexSet