【发布时间】:2020-01-25 16:28:51
【问题描述】:
我需要在 GraphQL 突变中发布一个大型有效负载。如何增加 Apollo Server 的 body size 限制?
我使用的是apollo-server-express 2.9.3 版。
我的代码(简化):
const myGraphQLSchema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
user: UserQuery,
},
}),
mutation: new GraphQLObjectType({
name: 'Mutation',
fields: () => ({
...UserMutations,
}),
}),
});
const apolloServer = new ApolloServer(schema: myGraphQLSchema);
const app = express();
app.use(apolloServer.getMiddleware({ path: '/graphql' });
【问题讨论】:
标签: express graphql apollo apollo-server