diff --git a/pages/search/+Page.vue b/pages/search/+Page.vue index 87bd1f9..33dac13 100644 --- a/pages/search/+Page.vue +++ b/pages/search/+Page.vue @@ -105,6 +105,7 @@ const query = pageContext.urlParsed.search.q; .page { display: flex; flex-direction: column; + flex-grow: 1; } .row { diff --git a/src/web/graphql.js b/src/web/graphql.js new file mode 100644 index 0000000..ccae6b6 --- /dev/null +++ b/src/web/graphql.js @@ -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); +}