payload
payload copied to clipboard
Relationship field - 431 (Request Header Fields Too Large)
Link to reproduction
No response
Payload Version
3.0.0-beta.36
Node Version
v22.1.0
Next.js Version
15.0.0-rc.0
Describe the Bug
When you add new items to a relationship field the system will query which items should be listed. The query will have a not_in list so that currently selected items will not show up again in the list to add again. When you have a lot of items this not_in list will become quite large. As the query to show the options is a GET request it will eventually fail with 431 (Request Header Fields Too Large) when the number of items in the relationship field makes the query too long for what is allowed by browser/http standard.
Ref discussion https://github.com/payloadcms/payload/discussions/1977
Reproduction Steps
- Have a field of type relationship field and allow hasMany
- Add many items to the relationship field (many many 100s)
- After adding enough items to the field it will eventuall give 431 (Request Header Fields Too Large) error
Adapters and Plugins
No response