Querying entity scenes from top level.

This commit is contained in:
DebaucheryLibrarian 2023-06-18 02:29:10 +02:00
parent 67365507b5
commit fe460f7441
1 changed files with 31 additions and 23 deletions

View File

@ -14,7 +14,7 @@ function initEntitiesActions(store, router) {
}) { }) {
const { before, after, orderBy } = getDateRange(range); const { before, after, orderBy } = getDateRange(range);
const { entity, batches: [lastBatch] } = await graphql(` const { entity, connection, batches: [lastBatch] } = await graphql(`
query Entity( query Entity(
$entitySlug: String! $entitySlug: String!
$entityType: String! = "channel" $entityType: String! = "channel"
@ -84,11 +84,20 @@ function initEntitiesActions(store, router) {
hasLogo hasLogo
${campaignsFragment} ${campaignsFragment}
} }
connection: scenesConnection( }
connection: releasesConnection(
first: $limit first: $limit
offset: $offset offset: $offset
orderBy: $orderBy orderBy: $orderBy
filter: { filter: {
entity: {
slug: {
equalTo: $entitySlug
}
type: {
equalTo: $entityType
}
}
effectiveDate: { effectiveDate: {
lessThan: $before, lessThan: $before,
greaterThan: $after greaterThan: $after
@ -109,7 +118,6 @@ function initEntitiesActions(store, router) {
} }
totalCount totalCount
} }
}
${batchFragment} ${batchFragment}
} }
`, { `, {
@ -131,8 +139,8 @@ function initEntitiesActions(store, router) {
} }
return { return {
entity: curateEntity(entity, null, entity.connection.releases, { lastBatch: lastBatch.id }), entity: curateEntity(entity, null, connection.releases, { lastBatch: lastBatch.id }),
totalCount: entity.connection.totalCount, totalCount: connection.totalCount,
}; };
} }