internal library

Helpers referenced by generated code. Not part of the public API; may change between minor versions together with the generator.

Classes

GqlifyConvert<J, T>
A J JSON value converted by convert (enums, custom scalars). Exceptions thrown by convert become decoding errors.
GqlifyDecoder<T>
Decodes one JSON value into T.
GqlifyEnum<T>
A GraphQL enum value decoded by the generated enum's fromJson.
GqlifyList<T>
A JSON array of inner values.
GqlifyNullable<T extends Object>
null, or inner for anything else.
GqlifyObject<T>
A JSON object decoded by a generated fromJson.

Constants

gqlifyBool → const GqlifyDecoder<bool>
Boolean!.
gqlifyDouble → const GqlifyDecoder<double>
Float!: any JSON number.
gqlifyInt → const GqlifyDecoder<int>
Int!.
gqlifyJson → const GqlifyDecoder<Object>
Any non-null JSON value (unmapped custom scalars).
gqlifyJsonList → const GqlifyDecoder<List<Object?>>
A JSON array, as-is.
gqlifyJsonObject → const GqlifyDecoder<Map<String, Object?>>
A JSON object, as-is.
gqlifyNum → const GqlifyDecoder<num>
Any JSON number as num.
gqlifyString → const GqlifyDecoder<String>
String! / ID!.

Functions

gqlifyCast<T>(Object? value, String location) → T
Casts a list element or nested value value to T.
gqlifyCastDouble(Object? value, String location) → double
Casts a Float! list element or nested value.
gqlifyCastDoubleOrNull(Object? value, String location) → double?
Casts a nullable Float list element or nested value.
gqlifyDecodeRoot<T>(T decode()) → T
Runs decode on a response root, converting failures to GqlifyDecodingException with the full response path.
gqlifyDeepEquals(Object? a, Object? b) → bool
Deep equality for (possibly nested) lists, maps and sets of generated or JSON values.
gqlifyDeepHash(Object? value) → int
Hash consistent with gqlifyDeepEquals.
gqlifyField<T>(Map<String, Object?> json, String key, GqlifyDecoder<T> decoder) → T
Reads json[key] with decoder, adding key to the path of failures.
gqlifyRead<T>(Map<String, Object?> json, String key, String owner) → T
Reads json[key] as T (which may be nullable).
gqlifyReadDouble(Map<String, Object?> json, String key, String owner) → double
Reads a GraphQL Float!, accepting any JSON number.
gqlifyReadDoubleOrNull(Map<String, Object?> json, String key, String owner) → double?
Reads a nullable GraphQL Float, accepting any JSON number.

Exceptions / Errors

GqlifyDecodeError
A decoding failure on its way up; converted to GqlifyDecodingException with the full path by gqlifyDecodeRoot (and by GqlifyClientBase).