Repository navigation
v0.11.0
Serialization modes. A new SchemaConfig.Serialization option controls how values are serialized to the built-in scalars (Int, Float, String, Boolean, ID) and to enums (#7):
- Lenient (default): unchanged. Values that cannot be serialized still become
nullor are converted as well as possible, silently:"12.50"for anIntbecomes12, a validsql.NullInt64becomesnull. - Strict: serializes as the GraphQL specification and
graphql-jsdo. Values are unwrapped first (driver.Valuer; forStringandID,encoding.TextMarshalerandfmt.Stringer). A value with a valid serialization returns it, and a value without one becomes a field error, such asInt cannot represent non-integer value: "12.50". - Report: returns exactly the lenient result and calls
OnInvalidValuewherever strict mode would respond differently, with aKind:invalid(strict returns a field error) orcorrected(strict returns another value, inStrictResult).
Enabling strict mode can change responses that are accepted today: dates become RFC 3339, and values that come out as null or wrong in lenient mode return their value. Run report mode first, review the corrected and invalid events, and only then switch to strict. See the README.
What's Changed
Features
- feat: report or reject values that cannot be serialized by @seriallink in #83
Bug fixes
- fix: preserve schema block string descriptions by @cloudgpuapp in #81
Documentation
- docs: add a banner to the README by @seriallink in #80
Maintenance
- test: cover nested description round trips by @seriallink in #87
New Contributors
- @cloudgpuapp made their first contribution in #81
Full Changelog: v0.10.0...v0.11.0