Querying entity scenes from top level.
This commit is contained in:
parent
67365507b5
commit
fe460f7441
|
@ -14,7 +14,7 @@ function initEntitiesActions(store, router) {
|
|||
}) {
|
||||
const { before, after, orderBy } = getDateRange(range);
|
||||
|
||||
const { entity, batches: [lastBatch] } = await graphql(`
|
||||
const { entity, connection, batches: [lastBatch] } = await graphql(`
|
||||
query Entity(
|
||||
$entitySlug: String!
|
||||
$entityType: String! = "channel"
|
||||
|
@ -84,11 +84,20 @@ function initEntitiesActions(store, router) {
|
|||
hasLogo
|
||||
${campaignsFragment}
|
||||
}
|
||||
connection: scenesConnection(
|
||||
}
|
||||
connection: releasesConnection(
|
||||
first: $limit
|
||||
offset: $offset
|
||||
orderBy: $orderBy
|
||||
filter: {
|
||||
entity: {
|
||||
slug: {
|
||||
equalTo: $entitySlug
|
||||
}
|
||||
type: {
|
||||
equalTo: $entityType
|
||||
}
|
||||
}
|
||||
effectiveDate: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after
|
||||
|
@ -109,7 +118,6 @@ function initEntitiesActions(store, router) {
|
|||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
${batchFragment}
|
||||
}
|
||||
`, {
|
||||
|
@ -131,8 +139,8 @@ function initEntitiesActions(store, router) {
|
|||
}
|
||||
|
||||
return {
|
||||
entity: curateEntity(entity, null, entity.connection.releases, { lastBatch: lastBatch.id }),
|
||||
totalCount: entity.connection.totalCount,
|
||||
entity: curateEntity(entity, null, connection.releases, { lastBatch: lastBatch.id }),
|
||||
totalCount: connection.totalCount,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue