Skip to content

Commit

Permalink
Back to previous name
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Apr 27, 2024
1 parent d50992c commit 47cf67b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Source, getOperationAST, parse } from 'graphql';
import { GraphQLValidationError } from '../../../services/graphql/errors/validation.js';
import type { GraphQLParams } from '../../../types/index.js';

export const graphQl: RequestHandler = (req, res, next) => {
export const parseGraphQl: RequestHandler = (req, res, next) => {
if (req.method !== 'GET' && req.method !== 'POST') {
throw new MethodNotAllowedError({ allowed: ['GET', 'POST'], current: req.method });
}
Expand Down
6 changes: 3 additions & 3 deletions api/src/controllers/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Router } from 'express';
import { GraphQLService } from '../../services/graphql/index.js';
import asyncHandler from '../../utils/async-handler.js';
import { respond } from '../handlers/respond.js';
import { graphQl } from './handlers/graphql.js';
import { parseGraphQl } from './handlers/parse-graphql.js';

const router = Router();

router.use(
'/system',
graphQl,
parseGraphQl,
asyncHandler(async (req, res, next) => {
const service = new GraphQLService({
accountability: req.accountability,
Expand All @@ -29,7 +29,7 @@ router.use(

router.use(
'/',
graphQl,
parseGraphQl,
asyncHandler(async (req, res, next) => {
const service = new GraphQLService({
accountability: req.accountability,
Expand Down

0 comments on commit 47cf67b

Please sign in to comment.