From edf7df60653008a3065c3a7baccc16814ab60254 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Wed, 6 Nov 2019 01:28:10 +0300 Subject: [PATCH] fix: use AST for graphql client example --- packages/graphql/example/bin/main.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/graphql/example/bin/main.dart b/packages/graphql/example/bin/main.dart index d6fbd9831..0863ddef1 100644 --- a/packages/graphql/example/bin/main.dart +++ b/packages/graphql/example/bin/main.dart @@ -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 = @@ -40,7 +41,7 @@ void query() async { const int nRepositories = 50; final QueryOptions options = QueryOptions( - document: readRepositories, + documentNode: parseString(readRepositories), variables: { 'nRepositories': nRepositories, }, @@ -72,7 +73,7 @@ void starRepository(String repositoryID) async { final GraphQLClient _client = client(); final MutationOptions options = MutationOptions( - document: addStar, + documentNode: parseString(addStar), variables: { 'starrableId': repositoryID, }, @@ -105,7 +106,7 @@ void removeStarFromRepository(String repositoryID) async { final GraphQLClient _client = client(); final MutationOptions options = MutationOptions( - document: removeStar, + documentNode: parseString(removeStar), variables: { 'starrableId': repositoryID, },