simple_gql 1.1.0+1 copy "simple_gql: ^1.1.0+1" to clipboard
simple_gql: ^1.1.0+1 copied to clipboard

outdated

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);
  }
}
8
likes
0
pub points
23%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, meta

More

Packages that depend on simple_gql