Expanded GraphQL API with scenes entities and actors.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user