Skip to content

Commit

Permalink
fix: request entity too large
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed May 16, 2024
1 parent 680714f commit 0782ba9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/src/graphql/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import type express from 'express';
import express from 'express';
import { ApolloServerPlugin, ApolloServer } from '@apollo/server';
import { expressMiddleware } from '@apollo/server/express4';
import bodyParser from 'body-parser';
Expand Down Expand Up @@ -45,11 +45,14 @@ export const addGraphqlRoutes = async (
await apolloIndex.start();
await apolloDrive.start();

router.use(bodyParser.json({ limit: "50mb" }));
router.use(bodyParser.urlencoded({ limit: "50mb", extended: true, parameterLimit: 50000 }));


router.use(
'/drives',
cors<cors.CorsRequest>(),
cookierParser(undefined, { decode: (value: string) => value }),
bodyParser.json(),
expressMiddleware(apolloIndex, {
context: async (params) => createIndexContext(params),
}),
Expand All @@ -59,7 +62,6 @@ export const addGraphqlRoutes = async (
'/d/:driveId',
cors<cors.CorsRequest>(),
cookierParser(undefined, { decode: (value: string) => value }),
bodyParser.json(),
expressMiddleware(apolloDrive, {
context: async (params) => createDriveContext(params),
}),
Expand Down

0 comments on commit 0782ba9

Please sign in to comment.