-
-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
I'm trying to read fragment from cache with this code
_graphQLClient.readFragment_ConvergedCartDetailsTest( idFields: {'__typename': 'ConvergedCart', 'ccid': ccid}, );
here is a fragment definition
fragment ConvergedCartDetailsTest on ConvergedCart{
ccid
version
subCarts
{
itemGroups {
items
{
price {
...priceFragment
}
}
}
}
}
fragment priceFragment on Price
{
priceId
... on SubsidyPrice {
payTodayPrice
}
}
but, it loads incomplete data for the fragment and it fails to parse from json because of required fields missing

priceId and payTodayPrice fields are missing.
although, if I don't insert price query as a fragment then it works.
The fragment:
fragment ConvergedCartDetailsTest on ConvergedCart{
ccid
version
subCarts
{
itemGroups {
items
{
price {
priceId
... on SubsidyPrice {
payTodayPrice
}
}
}
}
}
}
In this case I can successfully read the fragment

I done some research and these values are lost during the normalization and they are not saved into the cache if I use first fragment where another fragment is used for price field which is an interface type.

this is the schema for Price type
""" Can be subsidy or loan """
interface Price {
priceId: String!
payTodayPrice: Float
# other fields removed
}
""" Represents a subsidy price """
type SubsidyPrice implements Price {
priceId: String!
payTodayPrice: Float
# other fields removed
}
""" Represents a loan price """
type LoanPrice implements Price {
priceId: String!
payTodayPrice: Float
# other fields removed
}
Metadata
Metadata
Assignees
Labels
No labels