|
@@ -386,6 +386,13 @@ const anonResolvers = ['login', 'createUser'];
|
|
|
}
|
|
|
|
|
|
app.use('/graphql', express_graphql(async (req, res, gql) => {
|
|
|
+ if (!gql.query){
|
|
|
+ return {
|
|
|
+ schema: schema,
|
|
|
+ rootValue: rootResolvers,
|
|
|
+ graphiql: true,
|
|
|
+ }
|
|
|
+ }
|
|
|
const operationMatch = gql.query.match(/\{\s*([a-zA-Z]+)\s*/)
|
|
|
const operationName = operationMatch[1]
|
|
|
const authorization = req.headers.authorization
|