graphql_server3 3.2.0
graphql_server3: ^3.2.0 copied to clipboard
A GraphQL server runtime for Dart. Executes queries, mutations and subscriptions against a graphql_schema3 schema, with introspection built in.
Change Log #
3.2.0 #
First release published to pub.dev. graphql_schema3 and graphql_parser3 are
now hosted dependencies rather than git ones, which is what publishing requires
and what lets a consumer resolve the whole stack from pub.
Fixed #
- A fragment that spreads itself, directly or through a chain, no longer takes
the isolate down. The guard that remembers which fragments have been expanded
was rebuilt at every level of the recursion instead of being shared with it,
so
fragment f on User { name ...f }recursed until the stack ran out. Forty characters of query were enough to stop the server. - A response key merged from several selections resolves its field once.
{ user { name } user { age } }groups two selections underuserand used to call theuserresolver twice, once per selection, keeping the second answer. Every resolver that costs a query was paying that twice. @skip: trueand@include: falsein their shorthand form now do what they say. The directive lookup compared the value a directive carried against the directive's own name, which no shorthand can ever satisfy, so the field was rendered regardless. Directives are matched on their name.- A document holding several operations without an
operationNamesaid "This document does not define any operations", which describes the opposite problem. The two cases are told apart. makeLazythrew away the result of its own recursion, so a@jsonpathvariable sitting inside a nested map was never completed; andcompleteValuedropped the pending list when it unwrapped a non-nullable type, losing the same completions behind anyT!field.
Changed #
GraphQL.collectFieldstakes itsvisitedFragmentsguard as aSet<String?>rather than aList. It is public, so this is a breaking signature, but it is an implementation detail of the execution algorithm and passing it explicitly was never useful.
Added #
- Tests for directives, variables and their defaults, aliases, merged selection sets, lists, nulls, mutations, resolver failures, operation selection and fragment cycles. 42 in all, and three of them record, deliberately, that a document is executed without ever being validated against the schema: an unknown field or fragment yields an empty object and an undeclared variable resolves to null, rather than raising an error.
3.1.0 #
Removed #
lib/mirrors.dart, which was neither exported nor imported anywhere. It also pulled indart:mirrors, which rules out AOT compilation, Flutter and the web for anyone who happened to import it.- The
angel3_serializedependency, whoseExcludeandAliasannotations were used by that file alone. - The
tupledependency: declared, never imported. - The
recasedependency. It served a single conversion, spelling__DirectiveLocationvalues in screaming snake case, now done in place.
Fixed #
- Numeric scalars accept an integer where the schema says
Float. The specification coerces in that direction, and a decoded body hands over anint, sosum(value: 4)used to fail with a cast error both from a literal and from a variable.
Added #
- A test suite. There was none.
3.0.0 #
- Initial release