Skip to content

Instantly share code, notes, and snippets.

@r3dm1ke
Created April 21, 2020 18:12
Show Gist options
  • Select an option

  • Save r3dm1ke/842f9851ecabff0312bd5dcfafd92b60 to your computer and use it in GitHub Desktop.

Select an option

Save r3dm1ke/842f9851ecabff0312bd5dcfafd92b60 to your computer and use it in GitHub Desktop.
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