gql_build 0.2.1-alpha+1627928497520 gql_build: ^0.2.1-alpha+1627928497520 copied to clipboard
Useful builders for your GraphQL SDL and documents. Based on package:gql_code_builder and package:build
A package for Dart code generation from GraphQL source.
Builders in this package let you build your GraphQL requests and view the response in a type-safe way.
Usage example #
See the gql_example_cli or gql_example_flutter for usage examples.
Provided builders #
ast_builder #
Generates an AST representation of a GraphQL Document
data_builder #
Generates a typed view of your data.
var_builder #
Creates data classes for any GraphQL variables used in a query or fragment.
schema_builder #
Creates data classes from your specified graphql schema.
Configuration
type_overrides
: [Map] Specify how scalar types should be serialized
Example:
type_overrides:
CustomStringScalar:
name: String
CustomField:
name: CustomField
import: 'package:mypackage/custom_field.dart'
enum_fallbacks
: [Map] Specify fallback values to enum values in order to not break the serializer when
new enum values are added to the schema and the client has not updated to the new schema yet.
global_enum_fallbacks
: [bool] Add a generated fallback value for each enum value (except for ones that have a custom fallback value specified in the enum_fallbacks map).
Defaults to false.
Example:
global_enum_fallbacks: true # add a generated fallback value to all enums
enum_fallbacks:
MyEnumType: OTHER # except for the type 'MyEnumType', use the value 'OTHER' as fallback there
serializer_builder #
Creates built_value
serializers for each built_value
class.
Features and bugs #
Please file feature requests and bugs at the issue tracker.