Skip to main content

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

Lightweight, pure-Dart runtime for code generated by gqlify: injectable transports, typed operation results and explicit GraphQL error semantics.

gqlify

gqlify_runtime #

The small runtime that code generated by gqlify runs on. You add it as a normal dependency, and gqlify does the rest.

dependencies:
  gqlify_runtime: ^0.1.0

Most of the time, the only thing you'll touch directly is the transport:

final api = GqlifyClient(
  transport: HttpTransport(
    Uri.parse('https://api.example.com/graphql'),
    headersBuilder: (_) async => {'authorization': 'Bearer ${await token()}'},
    timeout: const Duration(seconds: 15),
  ),
);

What's inside:

  • HttpTransport: GraphQL over HTTP using package:http. It works on the Dart VM, Flutter and the web.
  • GqlifyTransport: a single-method interface, in case you want to plug in Dio, a cache or anything else.
  • MockTransport (in package:gqlify_runtime/testing.dart): test your app without a network.
  • Exceptions: GraphQLResponseException, GqlifyTransportException and GqlifyDecodingException, so you always know what went wrong.

No Flutter dependency and no global state.

Use the same minor version as gqlify (0.1.x with 0.1.x). See the gqlify README to get started.

0
likes
160
points
52
downloads
screenshot

Documentation

API reference

Publisher

verified publisherenver.dev

Weekly Downloads

Lightweight, pure-Dart runtime for code generated by gqlify: injectable transports, typed operation results and explicit GraphQL error semantics.

Repository (GitHub)
View/report issues

Topics

#graphql #http #api #client

License

MIT (license)

Dependencies

http

More

Packages that depend on gqlify_runtime