I'm receiving this error when querying the computed field topVideos on my shopifyShop model:
GGT_MISCONFIGURED_FIELD: The field topVideos is misconfigured and can't be resolved.
I've defined the field as follows:
topVideos: {
type: "computed",
sourceFile: "api/models/shopifyShop/topVideos.gelly",
storageKey: "xyz",
}
And in api/models/shopifyShop/topVideos.gelly:
field on shopifyShop {
topVideos {
returns List {
videoId: String
title: String
poster: String
watchCount: Int
}
resolve: aggregate(rsWatchHistories, { limit: 10 }) {
groupBy(rsWatchHistories.rsVideo.id)
select {
videoId: first(rsWatchHistories.rsVideo.id)
title: first(rsWatchHistories.rsVideo.title)
poster: first(rsWatchHistories.rsVideo.posterImageUrl)
watchCount: count(rsWatchHistories.rsVideo.id)
}
orderBy: watchCount desc
}
}
}
The relationships (rsWatchHistories and rsVideo) are correctly defined and the schema has been redeployed, yet the error persists. Any insight on what's missing or misconfigured?
Thanks in advance!