nuwave / nuwave/lighthouse

Allow disabling batched queries

Open
#2,046 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
3.5k
Forks
468
Avg merge
3h 9m
Merged PRs (30d)
2

Description

We are trying to disable batched queries using the provided config setting: 'batched_queries' = false,. The app still process all incoming queries, however, seemingly ignoring the setting.

I would expect to be thrown an error, for there to be an error message for each subsequent batched request, or for the additional requests to have been ignored entirely.

Steps to reproduce

  1. Set 'batched_queries' => false in the config/lighthouse.php file
  2. Rebuild containers and/or clear caches as appropriate
  3. Send the below JSON as the body of a POST request to the graphql endpoint
  4. Receive a response containing an array of two results instead of denying the request
[
	{
		"query": "query { batchOne: me { uuid } }"
	},
	{
		"query": "query { batchTwo: user(uuid: \"{UNIQUE_ID}\") { first_name } }"
	}
]


Output/Logs

image

Lighthouse Version
^5.38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with config/lighthouse.php and the GraphQL endpoint, then reproduce the issue using the provided batched JSON request with batched_queries set to false. Trace where the setting is read and how batched requests are handled; done means the configured behavior consistently rejects or ignores batched requests rather than returning two results.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, laravel, php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.