Fixed summary copy button value. Expanded experimental GraphQL API.

This commit is contained in:
2024-08-28 02:06:01 +02:00
parent e727745e7d
commit 24f5597521
3 changed files with 84 additions and 8 deletions

View File

@@ -71,28 +71,81 @@ export async function fetchScenesApi(req, res) {
}
export const scenesSchema = `
type Aggregate {
actors: [Actor]
}
type Result {
nodes: [Scene]
aggregates: Aggregate
}
type Scene {
id: Int!
title: String
effectiveDate: Date
shootId: Int
channel: Entity
network: Entity
actors: [Actor]
poster: Media
trailer: Media
photos: [Media]
covers: [Media]
}
type Actor {
id: Int!
name: String
slug: String
}
type Entity {
id: Int!
name: String
slug: String
parent: Entity
}
type Media {
id: String!
path: String
thumbnail: String
lazy: String
mime: String
hash: String
isS3: Boolean
width: Int
height: Int
size: Int
createdAt: Int
}
`;
export async function fetchScenesGraphql(query, req) {
const {
scenes,
/*
aggActors,
/*
aggTags,
aggChannels,
limit,
total,
*/
} = await fetchScenes({}, {
page: 1,
limit: 30,
page: query.page || 1,
limit: query.limit || 30,
}, req.user);
return scenes;
// console.log('agg actors', aggActors);
console.log('query', query);
return {
nodes: scenes,
aggregates: {
actors: aggActors,
},
};
/*
return {