simple_gql 1.1.1
simple_gql: ^1.1.1 copied to clipboard
A minimal library to do GraphQL queries and mutations (subscriptions not handled yet)
example/simple_gql_example.dart
import 'package:simple_gql/simple_gql.dart';
void main() async {
try {
final response = await GQLClient(
url: 'https://api.graph.cool/simple/v1/swapi',
).query(
query: r'''
query {
allPersons {
name
films {
director
}
}
}
''',
);
print('Yay, success ! :D');
print(response);
} on GQLError catch (e) {
print('Ouch ! :(');
print(e);
} catch (e) {
print('Probably a network error');
}
}