I have a problem while doing testing in SIT forward,
this forward is using old version of frontend and new version backend.
The structure of schema type is changing like this:
old backend:
type Product {
productName: String
productType: String
prices: PriceList
}
type PriceList {
id: String
priceDate: String
amount: Float
}
While in the new backend:
type Product {
productName: String
productType: String
prices: PriceList
}
type PriceList {
offset: Int
limit: Int
amount: Int
items: [Price]
}
type Price {
id: String
priceDate: String
currentPrice: Float
}
Here’s the query:
productDetail(productCode: String!, filter: ProductFilter):Product!
I’ve tried to use union
in GraphQL, here’s union that i try to create:
union PricesUnion = [Price] | PriceList
when filter is not provided while querying, i should return array of price without pagination. but i can’t use array of Price in union, based on docs it’s only work when the type is object.
Is this possible to do that? please give me advice. thank you.