Skip to content

Releases: apollographql/apollo-rs

[email protected]

14 Dec 14:55
40e499f
Compare
Choose a tag to compare

Fixes

  • fix panics when parsing type names with syntax errors - goto-bus-stop, pull/381

    For example, field: [] does not panic anymore. Instead it produces a syntax error and an incomplete List type.

  • continue parsing after a syntax error in an object type field - goto-bus-stop, pull/381

    type A {
       fieldA: [] # ← has error, missing item type
       fieldB: Int
       fieldC: Int
    }

    Previously fieldB and fieldC would not be parsed, now they are.

[email protected]

14 Dec 14:55
62f9e4a
Compare
Choose a tag to compare

Features

Fixes

  • do not panic when creating HIR from a parse tree with syntax errors - goto-bus-stop, pull/381

    When using the compiler, nodes with syntax errors in them are ignored. As syntax errors are returned
    from the parser, you can still tell that something is wrong. The compiler just won't crash the whole
    program anymore.

[email protected]

29 Nov 10:25
04db889
Compare
Choose a tag to compare

This is a re-publish of 0.3.0 with fixed dependency versions.

[email protected]

29 Nov 09:02
06cd0a7
Compare
Choose a tag to compare

BREAKING

  • make conversions from apollo-parser types fallible - goto-bus-stop, pull/371

    The parser-impl feature flag contains conversion code from apollo-parser AST node types
    to apollo-smith types. With this change, those conversions now use the TryFrom trait
    instead of the From trait, and return errors instead of panicking.

    You now have to use the try_from() and try_into() methods instead of from() and
    into().

[email protected]

29 Nov 08:50
f1544db
Compare
Choose a tag to compare

BREAKING

  • make conversions from GraphQL Values to Rust types fallible - goto-bus-stop, pull/371 fixing issue/358

    In the past you could do:

    let graphql_value: IntValue = get_a_value();
    let x: i32 = graphql_value.into();

    But this .into() implementation could panic if the number was out of range.
    Now, this conversion is implemented with the TryFrom trait, so you handle out-of-range errors however you want:

    let graphql_value: IntValue = get_a_value();
    let x: i32 = graphql_value.try_into()?;
  • Move with_recursion_limit constructor to a builder method - goto-bus-stop, pull/347

    If you were using the Parser::with_recursion_limit constructor, you now need to use Parser::new().recursion_limit() instead.

Features

  • add API to limit number of tokens to parse - goto-bus-stop, pull/347

    When dealing with untrusted queries, malicious users can submit very large queries to attempt to cause
    denial-of-service by using lots of memory. To accompany the existing recursion_limit API preventing
    stack overflows, you can now use token_limit to abort parsing when a large number of tokens is reached.

    You can use the new err.is_limit() API to check if a parse failed because a hard limit was reached.

    let source = format!("query {{ {fields} }}", fields = "a ".repeat(20_000));
    
    let parser = Parser::new(source)
        .recursion_limit(10)
        // You may need an even higher limit if your application actually sends very large queries!
        .token_limit(10_000);
    
    let (ast, errors) = parser.parse();
    if errors.iter().any(|err| err.is_limit()) {
        // there was a limiting error
    }

Maintenance

[email protected]

29 Nov 09:31
1a2e530
Compare
Choose a tag to compare

BREAKING

[email protected]

29 Nov 10:13
15bb1f2
Compare
Choose a tag to compare

Features

  • add parser recursion limit API - SimonSapin, pull/353, issue/296

    Calling ApolloCompiler::with_recursion_limit instead of ApolloCompiler::new
    makes the compiler configure the corresponding parser limit.
    This limit protects against stack overflow and is enabled either way.
    Configuring it may be useful for example if you’re also configuring the stack size.

  • expose the repeatable attribute on DirectiveDefinition - allancalix, pull/367

    There was previously no way to access the repeatable field on the DirectiveDefinition type.
    This field is required for validation rules.

  • add type extensions - SimonSapin, pull/369

    apollo-compiler now partially supports GraphQL extend types. The is_subtype query takes
    extensions into account.

    Some other parts of the compiler, like validation, do not yet support extensions.

Fixes

  • fix @include allowed directive locations - allancalix, pull/366

    The locations for the @include directive wrongly specified FragmentDefinition instead of FragmentSpread.
    It now matches the spec.

Maintenance

  • avoid double lookup in SchemaDefinition::{query,mutation,subscription} - SimonSapin, pull/364

[email protected]

15 Nov 11:40
d77e358
Compare
Choose a tag to compare

0.3.2 - 2022-11-15

Fixes

"""unicode in block string 🤷"""
input Filter {
    title: String
}
"""
\""" a/b \"""
"""
input Filter {
    title: String
}

type Query {
    format: String = "Y-m-d\\TH:i:sP"
}

[email protected]

08 Nov 10:48
2dee332
Compare
Choose a tag to compare

BREAKING

  • update [email protected] - lrlna, pull/340, pull/348

    This change was first released in the [email protected] patch release.
    It should have been a breaking change, as the update to the new version
    requires users to also update apollo-parser to 0.3.0 at the same time.

    This version is identical to 0.1.5 except for the version number.
    apollo-smith versions 0.1.4 and 0.1.5 have been yanked.

[email protected]

04 Nov 17:36
Compare
Choose a tag to compare