Skip to content

Commit

Permalink
feat(ferry_cache): use varsToJson instead of casting to dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
knaeckeKami committed Nov 10, 2023
1 parent f7d87a2 commit fbd0b3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
12 changes: 4 additions & 8 deletions packages/ferry_cache/lib/src/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ class Cache {
document: request.operation.document,
addTypename: addTypename,
operationName: request.operation.operationName,
// TODO: don't cast to dynamic
variables: (request.vars as dynamic)?.toJson(),
variables: request.varsToJson,
typePolicies: typePolicies,
dataIdFromObject: dataIdFromObject,
possibleTypes: possibleTypes,
Expand All @@ -147,8 +146,7 @@ class Cache {
document: request.document,
idFields: request.idFields,
fragmentName: request.fragmentName,
// TODO: don't cast to dynamic
variables: (request.vars as dynamic)?.toJson(),
variables: request.varsToJson,
typePolicies: typePolicies,
addTypename: addTypename,
dataIdFromObject: dataIdFromObject,
Expand Down Expand Up @@ -179,8 +177,7 @@ class Cache {
),
document: request.operation.document,
operationName: request.operation.operationName,
// TODO: don't cast to dynamic
variables: (request.vars as dynamic)?.toJson(),
variables: request.varsToJson,
data: (data as dynamic)?.toJson(),
typePolicies: typePolicies,
addTypename: addTypename,
Expand Down Expand Up @@ -212,8 +209,7 @@ class Cache {
document: request.document,
idFields: request.idFields,
fragmentName: request.fragmentName,
// TODO: don't cast to dynamic
variables: (request.vars as dynamic)?.toJson(),
variables: request.varsToJson,
data: (data as dynamic)?.toJson(),
typePolicies: typePolicies,
addTypename: addTypename,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Stream<Set<String>> fragmentDataChangeStream<TData, TVars>(
idFields: request.idFields,
fragmentName: request.fragmentName,
document: request.document,
// TODO: don't cast to dynamic
variables: (request.vars as dynamic)?.toJson(),
variables: request.varsToJson,
typePolicies: typePolicies,
addTypename: addTypename,
returnPartialData: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ Stream<Set<String>> operationDataChangeStream<TData, TVars>(
},
document: request.operation.document,
operationName: request.operation.operationName,
// TODO: don't cast to dynamic
variables: (request.vars as dynamic)?.toJson(),
variables: request.varsToJson,
typePolicies: typePolicies,
addTypename: addTypename,
returnPartialData: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/ferry_cache/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://ferrygraphql.com/
description: A normalized, strongly typed, optimistic cache for GraphQL Operations and Fragments
repository: https://github.com/gql-dart/ferry
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=3.0.0 <4.0.0'
dependencies:
ferry_exec: ^0.4.0
meta: ^1.3.0
Expand Down

0 comments on commit fbd0b3f

Please sign in to comment.