You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
The text was updated successfully, but these errors were encountered:
👋 @bekaIva
Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible.
Please make sure you have provided enough context.
This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.
On the face of it, this doesn't sound like an issue with graphql codegen. A simple test would be to see if you are experiencing the same issues by calling the underlying client directly. Unless you find some errors in the generated code, I suspect you will be able to find the same issues.
I don't know how you populate or configure your cache, but that would be my recommendation for you to look at first.
I'm trying to read fragment from cache with this code
_graphQLClient.readFragment_ConvergedCartDetailsTest( idFields: {'__typename': 'ConvergedCart', 'ccid': ccid}, );
here is a fragment definition
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:
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
The text was updated successfully, but these errors were encountered: