Skip to content

Commit dc5207a

Browse files
committed
fix(graphql): Normalization signature
1 parent 7a84abb commit dc5207a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/graphql/lib/src/cache/_normalizing_data_proxy.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class NormalizingDataProxy extends GraphQLDataProxy {
6565
/// The key differentiating factor for an implementing `cache` or `proxy`
6666
/// is usually how they handle [optimistic] reads.
6767
@protected
68-
Map<String, dynamic>? readNormalized(String rootId, {bool? optimistic});
68+
Map<String, dynamic>? readNormalized(String rootId, {bool optimistic});
6969

7070
/// Write normalized data into the cache.
7171
///
@@ -80,7 +80,7 @@ abstract class NormalizingDataProxy extends GraphQLDataProxy {
8080

8181
Map<String, dynamic>? readQuery(
8282
Request request, {
83-
bool? optimistic = true,
83+
bool optimistic = true,
8484
}) =>
8585
denormalizeOperation(
8686
// provided from cache
@@ -100,7 +100,7 @@ abstract class NormalizingDataProxy extends GraphQLDataProxy {
100100

101101
Map<String, dynamic>? readFragment(
102102
FragmentRequest fragmentRequest, {
103-
bool? optimistic = true,
103+
bool optimistic = true,
104104
}) =>
105105
denormalizeFragment(
106106
// provided from cache

packages/graphql/lib/src/cache/_optimistic_transactions.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class OptimisticProxy extends NormalizingDataProxy {
5959

6060
@override
6161
Map<String, dynamic>? readNormalized(String rootId,
62-
{bool? optimistic = true}) {
63-
if (!optimistic!) {
62+
{bool optimistic = true}) {
63+
if (!optimistic) {
6464
return cache.readNormalized(rootId, optimistic: false);
6565
}
6666
// the cache calls `patch.data.containsKey(rootId)`,

packages/graphql/lib/src/cache/data_proxy.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import './fragment.dart';
9898
/// ```
9999
abstract class GraphQLDataProxy {
100100
/// Reads a GraphQL query from the root query id.
101-
Map<String, dynamic>? readQuery(Request request, {bool? optimistic});
101+
Map<String, dynamic>? readQuery(Request request, {bool optimistic});
102102

103103
/// Reads a GraphQL fragment from any arbitrary id.
104104
///
@@ -107,7 +107,7 @@ abstract class GraphQLDataProxy {
107107
/// to select the correct fragment.
108108
Map<String, dynamic>? readFragment(
109109
FragmentRequest fragmentRequest, {
110-
bool? optimistic,
110+
bool optimistic,
111111
});
112112

113113
/// Writes a GraphQL query to the root query id,

0 commit comments

Comments
 (0)