Extended and improved transfer tool. Moved scenes up on movie page.

This commit is contained in:
DebaucheryLibrarian
2023-06-03 02:51:42 +02:00
parent 62617ec6bf
commit 4b9a0e6bab
10 changed files with 314 additions and 102 deletions

View File

@@ -1,12 +1,15 @@
'use strict';
const config = require('config');
const { withPostGraphileContext } = require('postgraphile');
const { graphql } = require('graphql');
const pg = require('./postgraphile');
const initPg = require('./postgraphile');
const logger = require('../logger')(__filename);
async function query(graphqlQuery, params) {
async function query(graphqlQuery, params, role = 'query') {
const pg = initPg(config.database[role]);
return withPostGraphileContext(pg, async (context) => {
const schema = await pg.getGraphQLSchema();
const result = await graphql(schema, graphqlQuery, null, context, params);