Skip to main content

gqlify 0.1.0 copy "gqlify: ^0.1.0" to clipboard
gqlify: ^0.1.0 copied to clipboard

GraphQL, simplified for Dart. A build-time GraphQL code generator producing small, strongly typed Dart APIs from a schema and operation documents.

example/README.md

gqlify example #

A complete, runnable example lives in the repository's example/ package. In short:

# pubspec.yaml
dependencies:
  gqlify_runtime: ^0.1.0
dev_dependencies:
  gqlify: ^0.1.0

gqlify:
  schema: lib/graphql/schema.graphql
# lib/graphql/products.graphql
query GetProduct($sku: ID!) {
  product(sku: $sku) { sku name price }
}
dart run gqlify generate      # or: dart run build_runner build
import 'package:gqlify_runtime/gqlify_runtime.dart';
import 'graphql/schema.graphql.dart';
import 'graphql/products.graphql.dart';

Future<void> main() async {
  final api = GqlifyClient(
    transport: HttpTransport(Uri.parse('https://shop.example/graphql')),
  );
  final data = await api.getProduct(sku: 'ABC123');
  print(data.product?.name);
}
0
likes
160
points
50
downloads
screenshot

Documentation

API reference

Publisher

verified publisherenver.dev

Weekly Downloads

GraphQL, simplified for Dart. A build-time GraphQL code generator producing small, strongly typed Dart APIs from a schema and operation documents.

Repository (GitHub)
View/report issues

Topics

#graphql #codegen #build-runner #api #code-generation

License

MIT (license)

Dependencies

args, build, collection, crypto, dart_style, glob, gql, path, pub_semver, source_span, yaml

More

Packages that depend on gqlify