brick_graphql_generators 2.0.1 copy "brick_graphql_generators: ^2.0.1" to clipboard
brick_graphql_generators: ^2.0.1 copied to clipboard

Code generation library for the GraphQL providers, models, and adapters in Brick

brick_graphql_generators workflow

Brick GraphQL Build #

Code generator that provides (de)serializing functions for Brick adapters using GraphqlProvider. This package does not produce code. It can be imported into other Brick build domains.

This package should not be imported into an end application as it does not generate code.

Usage #

Apply the GraphQLSerdes in your own AnnotationSuperGenerator:

import 'package:brick_graphql_generators/graphql_serdes.dart';

class MyDomainGenerator extends AnnotationSuperGenerator<ConnectMyDomainWithGraphQL> {
  final String superAdapterName;
  final String repositoryName;

  const OfflineFirstGenerator({
    this.superAdapterName = 'MyDomain',
    this.repositoryName = 'MyDomainWithGraphQL',
  });

  /// Given an [element] and an [annotation], scaffold generators
  List<SerdesGenerator> buildGenerators(Element element, ConstantReader annotation) {
    final graphql = GraphQLSerdes(element, annotation, repositoryName: repositoryName);
    final otherProvider = OtherProviderSerdes(element, annotation, repositoryName: repositoryName);
    final generators = <SerdesGenerator>[];
    generators.addAll(graphql.generators);
    generators.addAll(otherProvider.generators);
    return generators;
  }
}
0
likes
110
pub points
41%
popularity

Publisher

unverified uploader

Code generation library for the GraphQL providers, models, and adapters in Brick

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, brick_build, brick_graphql, brick_json_generators, build, dart_style, source_gen

More

Packages that depend on brick_graphql_generators