simple_gql 1.1.1

Dart native js
Flutter Android iOS web

A minimal library to do GraphQL queries and mutations (subscriptions not handled yet)

A simple GraphQL library. Quite minimal and hopefully easy to use. GQL Subscriptions are not handled yet.

Usage #

A simple usage example:

import 'package:simple_gql/simple_gql.dart';

main() {
  try {
    final client = GQLClient(
      url: 'https://api.graph.cool/simple/v1/swapi',
    );
    final response = await client.query(
      query: r'''
        query {
          allPersons {
            name
            films {
              director
            }
          }
        }
      ''',
    );
    print(response);
  } on GQLError catch(e){
    print('here is a GraphQL error : $e');
  } catch(e) {
    print('unknown error. Usually due to a bad URL or problem with the connection');
    print(e);
  }
}
6
likes
100
pub points
57%
popularity

A minimal library to do GraphQL queries and mutations (subscriptions not handled yet)

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

lecuivre.alban@gmail.com

License

MIT (LICENSE)

Dependencies

http, meta

More

Packages that depend on simple_gql