Skip to content

Commit

Permalink
fix(client): gql_http_link==0.3.2 for custom toJsons closing #734
Browse files Browse the repository at this point in the history
  • Loading branch information
micimize committed Sep 26, 2020
1 parent 43d8cc4 commit 98b8cf7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
13 changes: 9 additions & 4 deletions packages/graphql/lib/src/cache/fragment.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'dart:convert';
import "package:meta/meta.dart";
import "package:collection/collection.dart";

import "package:gql/ast.dart";
import 'package:graphql/client.dart';
import "package:meta/meta.dart";
import 'package:gql/language.dart';
import "package:gql_exec/gql_exec.dart";

/// A fragment in a [document], optionally defined by [fragmentName]
@immutable
Expand Down Expand Up @@ -43,8 +46,10 @@ class Fragment {
);

@override
String toString() =>
"Fragment(document: $document, fragmentName: $fragmentName)";
String toString() {
final documentRepr = json.encode(printNode(document));
return "Fragment(document: DocumentNode($documentRepr), fragmentName: $fragmentName)";
}

/// helper for building a [FragmentRequest]
@experimental
Expand Down
3 changes: 3 additions & 0 deletions packages/graphql/lib/src/core/policies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class Policies {
int get hashCode => const ListEquality<Object>(
DeepCollectionEquality(),
).hash([fetch, error]);

@override
String toString() => 'Policies(fetch: $fetch, error: $error)';
}

/// The default [Policies] to set for each client action
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:

gql: ^0.12.3
gql_exec: ^0.2.4
gql_link: ^0.3.0
gql_http_link: ^0.3.1
gql_link: ^0.3.1
gql_http_link: ^0.3.2
gql_transform_link: ^0.1.5
gql_error_link: ^0.1.0
gql_dedupe_link: ^1.0.10
Expand Down

0 comments on commit 98b8cf7

Please sign in to comment.