Skip to content

Commit

Permalink
fix: use AST for graphql client example
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Nov 5, 2019
1 parent 0612d44 commit edf7df6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/graphql/example/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:graphql/client.dart';

import './graphql_operation/mutations/mutations.dart';
import './graphql_operation/queries/readRepositories.dart';
import 'package:gql/language.dart';

// to run the example, create a file ../local.dart with the content:
// const String YOUR_PERSONAL_ACCESS_TOKEN =
Expand Down Expand Up @@ -40,7 +41,7 @@ void query() async {
const int nRepositories = 50;

final QueryOptions options = QueryOptions(
document: readRepositories,
documentNode: parseString(readRepositories),
variables: <String, dynamic>{
'nRepositories': nRepositories,
},
Expand Down Expand Up @@ -72,7 +73,7 @@ void starRepository(String repositoryID) async {
final GraphQLClient _client = client();

final MutationOptions options = MutationOptions(
document: addStar,
documentNode: parseString(addStar),
variables: <String, dynamic>{
'starrableId': repositoryID,
},
Expand Down Expand Up @@ -105,7 +106,7 @@ void removeStarFromRepository(String repositoryID) async {
final GraphQLClient _client = client();

final MutationOptions options = MutationOptions(
document: removeStar,
documentNode: parseString(removeStar),
variables: <String, dynamic>{
'starrableId': repositoryID,
},
Expand Down

0 comments on commit edf7df6

Please # to comment.