Skip to content

Add note to body middleware, and write GraphQL body parser docs #498

@rajaomariajaona

Description

@rajaomariajaona

Bug report

Describe the bug

The request returns 413 Payload too large error when make graphql mutation with large String value (with base64)

Steps to reproduce the behavior

  • Create in content-builder an entity
  • Activate graphql
  • make mutation request with huge string value more than 1mb (with base64 for example)

Expected behavior

The request should return 200 and the mutation should be successful

Code snippets

My config (config/middleware.js)

module.exports = {
  settings: {
    parser: {
      formLimit: '10mb', // modify here limit of the form body
      jsonLimit: '10mb', // modify here limit of the JSON body
      textLimit: '10mb', // modify here limit of the text body
      formidable: {
        maxFileSize: 100 * 1024 * 1024, // multipart data, modify here limit of uploaded file size
      },
    },
  },
}

System

  • Node.js version: 14.18.1
  • NPM version: 6.14.15
  • Strapi version: 3.6.8
  • Database: Postgresql
  • Operating system: Ubuntu
  • Mode : dev (local)

Context

This config fixed the issue

Config in (config/plugins.js)

module.exports = {
  graphql: {
    endpoint: "/graph"
  }
};

Walking track

May be this condition is the problem
parser#L43

Metadata

Metadata

Assignees

Labels

issue: doc requestIssues that require adding new content, possibly with some prior researchseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: Dev DocsPRs/issues targeting the Developer Docstarget: v4Documentation PRs/issues targeting content from docs.strapi.io (main branch).

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions