Created
April 21, 2020 18:12
-
-
Save r3dm1ke/842f9851ecabff0312bd5dcfafd92b60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/foundation.dart'; | |
| import 'package:graphql_flutter/graphql_flutter.dart'; | |
| ValueNotifier<GraphQLClient> client = ValueNotifier( | |
| GraphQLClient( | |
| cache: InMemoryCache(), | |
| link: HttpLink(uri: 'http://10.0.2.2:3000'), | |
| ), | |
| ); | |
| final String getTasksQuery = """ | |
| query { | |
| allTodos { | |
| id, | |
| title, | |
| completed | |
| } | |
| } | |
| """; | |
| final String createTaskMutation = """ | |
| mutation CreateTodo(\$id: ID!, \$title: String!) { | |
| createTodo(id: \$id, title: \$title, completed: false) { | |
| id | |
| } | |
| } | |
| """; | |
| final String updateTaskMutation = """ | |
| mutation UpdateTodo(\$id: ID!, \$completed: Boolean!) { | |
| updateTodo(id: \$id, completed: \$completed) { | |
| id | |
| } | |
| } | |
| """; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment