diff --git a/packages/graphql/lib/src/cache/fragment.dart b/packages/graphql/lib/src/cache/fragment.dart index c6ce9de7b..5c3fb9be2 100644 --- a/packages/graphql/lib/src/cache/fragment.dart +++ b/packages/graphql/lib/src/cache/fragment.dart @@ -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 @@ -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 diff --git a/packages/graphql/lib/src/core/policies.dart b/packages/graphql/lib/src/core/policies.dart index bd1df5bf6..2573371fd 100644 --- a/packages/graphql/lib/src/core/policies.dart +++ b/packages/graphql/lib/src/core/policies.dart @@ -76,6 +76,9 @@ class Policies { int get hashCode => const ListEquality( DeepCollectionEquality(), ).hash([fetch, error]); + + @override + String toString() => 'Policies(fetch: $fetch, error: $error)'; } /// The default [Policies] to set for each client action diff --git a/packages/graphql/pubspec.yaml b/packages/graphql/pubspec.yaml index cb59bc077..4a9361a8d 100644 --- a/packages/graphql/pubspec.yaml +++ b/packages/graphql/pubspec.yaml @@ -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