graphql_schema3 3.2.3
graphql_schema3: ^3.2.3 copied to clipboard
An implementation of the GraphQL type system in Dart. Builds object, union, enum, input and scalar types, and validates and coerces values against them.
Change Log #
3.2.3 #
Changed #
homepagepoints at packages.comapps.be, where the demo site moved. The old address redirects there.- The badge row carries a PayPal donation badge,
fundingpoints pub.flutter-io.cn at the same donation page, and the README ends on the other packages COMAPPS publishes. Nothing about the library changed.
3.2.2 #
Changed #
- The README carries its build badge again, pointed at the branch the repository actually builds from.
homepagepoints at the package's card on comapps.web.app, which lists every package published under COMAPPS.- The README badge row carries the maintainer again, and a licence badge in a colour of its own rather than the grey shields puts in every label. Nothing about the library changed.
3.2.1 #
Changed #
LICENSEcarries a copyright notice for the work done on this line, next to the upstream one it has always kept, as the BSD-3-Clause terms require.AUTHORS.mdalready recorded who did what; the licence file now says the same thing.- The README says where to look for both, rather than describing the licence file as untouched.
- The README links each dependency to its pub.flutter-io.cn page. The pointer between these packages went to GitHub, which is the wrong destination from a pub.flutter-io.cn page.
No code changed.
3.2.0 #
First release published to pub.flutter-io.cn. The package was consumed straight from its git repository until now.
Fixed #
-
Validation refuses rather than raises. Every validator narrowed the parameter the base class declares
covariant- an object type took aMap, a list type aList, a bounded scalar its ownT- so a value of the wrong shape did not fail validation, it raised aTypeErrorfrom the call boundary. That is the one thing validation exists to prevent. All nine overrides takeObject?now and answer a failedValidationResult.The two shape checks that would have caught this were present but commented out, because with a
Map-typed parameter they were unreachable. They are restored along with the widened parameter. -
The bounded scalars measured the raw input rather than the validated value, and their supertype accepts
null, soGraphQLNumMinType.validate(key, null)crashed on the comparison. A null now passes the bound untouched: whether it is legal at all is the non-nullable wrapper's business, not the bound's.
Added #
example/main.dart: builds a small schema by hand, then validates values against it, including theInt/Floatcoercion rule.- Package metadata for pub.flutter-io.cn: a description that says what the package does rather than what to use instead, an issue tracker, and topics.
- 9 tests covering the above. 50 in all.
3.1.0 #
Fixed #
- Validating an unknown enum literal raised
Bad state: No elementinstead of returning a failedValidationResult. For a string-valued enum, built withenumTypeFromStrings, every literal took that path, so any client sending an unrecognised value crashed the resolver. Bothvalidateandconvertare affected. - A field whose input has the wrong type raised a cast error while validating
an object, rather than reporting the mismatch.
GraphQLType.convertnow answersnullfor a value of the wrong shape. Floatrejected an integer literal. The specification coerces an integer toFloat, and only in that direction, so4is now a validFloatwhile4.2remains an invalidInt.GraphQLFieldInput.operator ==comparedother.defaultValuewith itself, so two inputs differing only by their default value compared as equal.GraphQLEnumType,GraphQLObjectType,GraphQLInputObjectTypeandGraphQLUnionTypehashed the identity of their field list while comparing its contents, so two equal instances could carry different hash codes. That breaks theObjectcontract and, with it, anySetorMapkeyed on a type.GraphQLObjectType.hashCodeandGraphQLInputObjectType.hashCodefoldednamein twice and neverdescription.
Removed #
- The
quiverdependency. Itshash2/hash3/hash4were the only thing used andObject.hashcovers them.
Added #
- A test suite. There was none.
3.0.0 #
- Initial release