Expanded GraphQL API with scenes entities and actors.

This commit is contained in:
2024-08-30 02:28:44 +02:00
parent 706ccf1ab3
commit edb10c6d1a
8 changed files with 250 additions and 34 deletions

View File

@@ -85,6 +85,10 @@ export const scenesSchema = `
scene(
id: Int!
): Release
scenesById(
ids: [Int]!
): [Release]
}
type ReleasesAggregate {
@@ -115,12 +119,6 @@ export const scenesSchema = `
movies: [Release]
}
type Actor {
id: Int!
name: String
slug: String
}
type Tag {
id: Int!
name: String
@@ -184,8 +182,6 @@ export async function fetchScenesGraphql(query, req) {
aggregate: false,
}, req.user);
console.log(query);
return {
nodes: scenes,
total,
@@ -197,24 +193,17 @@ export async function fetchScenesGraphql(query, req) {
},
*/
};
/*
return {
scenes,
aggActors,
aggTags,
aggChannels,
limit,
total,
};
*/
}
export async function fetchScenesByIdGraphql(query, req) {
const [scene] = await fetchScenesById([query.id], {
const scenes = await fetchScenesById([].concat(query.id, query.ids).filter(Boolean), {
reqUser: req.user,
includePartOf: true,
});
return scene;
if (query.ids) {
return scenes;
}
return scenes[0];
}