Fixed search page collapsing when not enough results.

This commit is contained in:
DebaucheryLibrarian 2024-06-25 02:43:04 +02:00
parent b3c56a7e85
commit 4985a0eb59
2 changed files with 28 additions and 0 deletions

View File

@ -105,6 +105,7 @@ const query = pageContext.urlParsed.search.q;
.page {
display: flex;
flex-direction: column;
flex-grow: 1;
}
.row {

27
src/web/graphql.js Normal file
View File

@ -0,0 +1,27 @@
import { graphql, buildSchema } from 'graphql';
import { scenesSchema, fetchScenesGraphql } from './scenes.js';
const schema = buildSchema(`
type Query {
scenes: [Scene]
}
${scenesSchema}
`);
const rootValue = {
scenes: fetchScenesGraphql,
};
export async function graphqlApi(req, res) {
const data = await graphql({
schema,
source: req.body.query,
variableValues: req.body.variables,
rootValue,
});
console.log(data);
res.send(data);
}