Releases: apollographql/apollo-rs
[email protected]
0.2.0 - 2022-08-16
Breaking
-
inline_fragment().type_condition() returns Option<&str> - lrlna, pull/282
Instead of returning
Option<&String>
, we now returnOption<&str>
-
Value -> DefaultValue for default_value fields - lrlna, pull/276
default_value getters in Input Value Definitions and Variable Definitions now
returnDefaultValue
type. This is a type alias to Value, and makes it
consistent with the GraphQL spec.
Fixes
-
add type information to inline fragments - lrlna, pull/282, issue/280
Inline fragments were missing type correct type information. We now search for
applicable type's fields if a type condition exists, otherwise infer
information from the current type in scope (as per spec)
.Inline fragments -
fix cycle error in fragment spreads referencing fragments - lrlna, pull/283, issue/281
Because fragment definitions can have fragment spreads, we are running into a
self-referential cycle when searching for a fragment definition to get its id.
Instead, search for the fragment definition when getting a fragment in a
fragment spread in the wrapper API.
Features
-
pub use ApolloDiagnostic - EverlastingBugstopper, pull/268
Exports ApolloDiagnostic to allow users to use it in other contexts.
-
default_value getter in input_value_definition - lrlna, pull/273
A getter for default values in input value definitions.
-
feat(compiler): add db.find_union_by_name() - lrlna, pull/272
Allows to query unions in the database.
-
adds inline_fragments getter to SelectionSet - lrlna, pull/282
Convenience method to get all inline fragments in the current selection set.
[email protected]
[email protected]
0.1.0 - 2022-07-27
Introducing apollo-compiler
!
A query-based compiler for the GraphQL language.
The compiler provides validation and context for GraphQL documents with a comprehensive API.
This is still a work in progress, for outstanding issues, checkout out the
apollo-compiler label in our issue tracker.
[email protected]
0.2.8 - 2022-06-10
Fix
[email protected]
0.2.7 - 2022-06-08
Features
-
Resource bound parsing execution - garypen, pull/239 closes issue/225
Introduce recursion limit enforced during SelectionSet parsing.
There is now a default limit (4_096) applied to parsers during SelectionSet
parsing to help prevent stack overflows. This limit can be set manually when
creating a parser by using the new fn,Parser::with_recursion_limit()
.
Details about recursion consumption can be retrieved using the new fn
SyntaxTree::recursion_limit()
. Recursion limit details are also output as
part of the AST debug output when printing aSyntaxTree
.
[email protected]
0.2.6 - 2022-05-24
Fixes
-
lex escaped characters in StringValue tokens - bnjjj, pull/228 closes issue/227, issue/229
StringValues with correctly escaped quotation marks, e.g.
{ name(id: "\"escaped\"") }
would error and not lex correctly. Additionally, invalid escapes in string
values, e.g.{ name(id: "escaped \a") }
should have an error created in the
lexer. Both issues are fixed, and correctly bubble up to the parser.
[email protected]
[email protected]
0.3.1 - 2022-04-29
Fixes
[email protected]
[email protected]
0.3.0 - 2022-04-28
Important: 4 breaking change below, indicated by BREAKING
BREAKING
-
ArgumentsDefinition::new() creates an empty instance of ArgumentsDefinition - lrlna, pull/207
ArgumentsDefinition::new() now takes no arguments and creates a default empty
vector of input value definitions. Previously,::new()
would accept a vector of input value definitions. This API is now represented as::with_values()
. -
all descriptions setters accept paramater of type String - lrlna, pull/207
Previously all descriptions were set with a parameter of type
Option<String>
, which was not very user-friendly.let mut directive_def = DirectiveDefinition::new("provideTreat".to_string()); directive_def.description("Ensures cats get treats.".to_string());
-
all default setters accept paramater of type String - lrlna, pull/208
Similarly to above, previously all defaults were set with a parameter of type
Option<String>
. All defaults now acceptString
. -
all default value setters are renamed to
default_value
- lrlna, pull/208Previously used "default" setters represented "default_value". Renaming the
setters directly todefault_value
aligns with the spec.let ty = Type_::NamedType { name: "CatBreed".to_string() }; let mut field = InputField::new("cat".to_string(), ty); field.default_value("Norwegian Forest".to_string());
Features
-
ArgumentsDefinition input value setter - lrlna, pull/207
Individual input value definitions can be set with
input_value
setter:let input_value = InputValueDefinition::new( String::from("first"), Type_::NamedType { name: String::from("Int"), }, ); let args_definition = ArgumentsDefinition::new(); args_definition.input_value(input_value);
Fixes
-
Use a more readable serialisation for input value definitions - lrlna, pull/207
If any of the input value definitions in a given field definition comes with a
description, we will multiline all input value definitions. That is to say,
instead of serializing arguments definition like this:type Foo { "This is a description of the \`one\` field." one("This is a description of the \`argument\` argument." argument: InputType!): Type }
we serialize it as:
type Foo { "This is a description of the \`one\` field." one( "This is a description of the \`argument\` argument." argument: InputType! ): Type }
This makes it a lot more readable, especially for users with a large number of
input value definitions with descriptions.