Your product search has twelve filters, nested price ranges and a category list. As a GET, the URL turns into a paragraph. As a POST, every reload, deferred prop and “load more” forgets the filters. Inertia 3.10 speaks Laravel’s QUERY method, so the filters travel in the body and the page remembers them.
TL;DR
- Inertia 3.10.0 (October 30, 2026) adds
router.query(url, data),method="query"on<Link>and<Form>, and aquery()method onuseFormanduseHttp. - A page rendered by a
QUERYvisit remembers its body.router.reload(),<Deferred>, polling,<WhenVisible>and<InfiniteScroll>send it again. The URL doesn’t change. - inertia-laravel 3.6.0 turns a
302after aQUERYrequest into a303, so a failed validation redirects withGETinstead of replaying theQUERY. Update both packages together. - In our lab,
php artisan serveansweredQUERYwith 501, anduseFormdata with arrays needed a plain copy. Details below.
What’s new at a glance#
| Package | Version | What changed |
|---|---|---|
@inertiajs/vue3 (and React, Svelte) | 3.10.0 | QUERY visits, prefetch for QUERY, 15+ fixes for cancelled and stale requests |
inertiajs/inertia-laravel | 3.6.0 | 303 after QUERY redirects, a way to start SSR without stopping the other servers |
This is the last piece of the QUERY story on this site. Laravel added Route::query() in 13.35, then Wayfinder and Precognition learned the method. Back then we wrote “Inertia does not speak QUERY yet”. Now it does.
QUERY in one paragraph#
QUERY is a new HTTP method: safe and repeatable like GET, with a body like POST. It fits searches and filters with large or nested payloads. On the Laravel side it is one route:
use App\Http\Controllers\ProductController;
Route::get('/products', [ProductController::class, 'index'])->name('products.index');
Route::query('/products', [ProductController::class, 'index'])->name('products.search');Both routes point at the same action, so the first visit (GET) and every search (QUERY) render the same page. The controller reads the body with a normal FormRequest:
public function index(SearchProductsRequest $request): Response
{
$filters = $request->validated();
return Inertia::render('products/index', [
'filters' => $filters,
'products' => fn () => Product::query()
->when($filters['search'] ?? null, fn (Builder $q, string $s) => $q->whereLike('name', "%{$s}%"))
->when($filters['categories'] ?? null, fn (Builder $q, array $c) => $q->whereIn('category', $c))
->when($filters['price']['min'] ?? null, fn (Builder $q, int $min) => $q->where('price', '>=', $min))
->when($filters['price']['max'] ?? null, fn (Builder $q, int $max) => $q->where('price', '<=', $max))
->get(['id', 'name', 'category', 'price']),
'facets' => Inertia::defer(fn () => Product::query()
->selectRaw('category, count(*) as total')
->groupBy('category')
->pluck('total', 'category')),
]);
}Five ways to make a QUERY visit#
Every Inertia API that takes a method now accepts 'query'. We checked each one against the pull request source and ran it in a Vue 3 lab.
useForm: the search form#
Before 3.10, you had to pick between a long URL and a POST that is not really a write. Now the form has a query() method:
3.9: GET with a query string, then 3.10: QUERY with a body:
<script setup lang="ts">
import { useForm } from '@inertiajs/vue3'
const form = useForm({
search: '',
categories: [] as string[],
price: { min: null as number | null, max: null as number | null },
})
// /products?search=&categories[0]=Keyboards&categories[1]=Monitors&price[min]=100&price[max]=500
const apply = () => form.get('/products', { preserveState: true })
</script><script setup lang="ts">
import { useForm } from '@inertiajs/vue3'
const form = useForm({
search: '',
categories: [] as string[],
price: { min: null as number | null, max: null as number | null },
}).transform((data) => JSON.parse(JSON.stringify(data))) // see the gotcha below
// QUERY /products with {"search":"","categories":["Keyboards"],"price":{"min":100,"max":null}}
const apply = () => form.query('/products')
</script>QUERY visits preserve component state by default, like POST, PUT and PATCH. Your inputs keep their values when the results come back.
Gotcha: DataCloneError with arrays and nested objects
In our lab, form.query() with an array field (categories) or a nested object (price) failed with “Failed to execute ‘replaceState’ on ‘History’: [object Object] could not be cloned”, and the page did not update. Inertia 3.10.0 saves the request body in browser history, and the browser can’t copy Vue’s reactive arrays. A form with only strings worked. The one-line transform() above sends a plain copy, and everything worked after that. We’ll update this post when a fix ships.
router.query: from code#
import { router } from '@inertiajs/vue3'
router.query('/products', {
categories: ['Keyboards', 'Monitors'],
price: { min: 100, max: 500 },
})The signature is router.query(url, data, options), the same as router.post(). It sets preserveState: true for you.
Link: saved searches and quick filters#
<template>
<Link href="/products" method="query" :data="{ search: 'Acme' }" prefetch>
Acme products
</Link>
</template>QUERY is safe, so it can be prefetched. Each body gets its own cache entry, so two links to /products with different data don’t share a response. You can even prefetch the page you are on.
Form: no script at all#
<template>
<Form action="/products" method="query" #default="{ processing }">
<input name="search" />
<button type="submit" :disabled="processing">Search</button>
</Form>
</template>useHttp: JSON endpoints#
For a count badge or an autocomplete, you don’t want a page visit. useHttp gained query() too, and it returns the response:
import { useHttp } from '@inertiajs/vue3'
const counter = useHttp<{ categories: string[] }, { count: number }>({ categories: [] })
const { count } = await counter.query('/products/count')Our lab returned {"count":2,"method":"QUERY"} from a Route::query('/products/count', ...) route.
Tip: CSRF is already handled
Laravel checks the CSRF token on QUERY requests to web routes (a request without it got a 419 in our lab). Inertia’s HTTP client sends the X-XSRF-TOKEN header on same-origin requests for every method, so QUERY visits pass without extra code.
Reloads keep the filters#
This is the part that makes QUERY better than “just use POST”. A page rendered by a QUERY visit remembers the body. Anything that reloads the page sends it again:
router.reload({ only: ['products'] }) // sent as QUERY with the same filtersThe same goes for <Deferred>, polling, <WhenVisible> and <InfiniteScroll>. In our lab, the deferred facets prop and a partial reload both went out as QUERY with the original JSON body. <InfiniteScroll> adds the page number to the body ({"term":"Apple","page":2} in the Inertia test suite).
A few rules, all from the pull request and confirmed in the lab:
| Situation | What happens |
|---|---|
router.reload() on a QUERY page | Sent as QUERY with the remembered body |
router.reload({ data: { search: 'x' } }) | Your data is merged on top of the remembered body |
router.reload({ method: 'get' }) | Uses GET, the body is not sent |
| Back, then Forward | The body is restored with the page |
| Browser refresh (F5) | A normal GET /products: the filters are gone |
| A visit that ends on another page | The body is dropped |
Heads up: QUERY or GET?
The URL doesn’t change, so filters aren’t in browser history, can’t be shared and don’t survive a refresh. If users bookmark or share searches, keep GET with a query string. Use QUERY when the payload is too big or too nested for a URL, or when you don’t want filters in logs and history.
inertia-laravel 3.6: redirects after QUERY#
What happens when validation fails? Laravel redirects back with a 302. Browsers only switch to GET when they follow a 302 after a POST. For any other method, they replay the same method and body to the new URL. Inertia already turned 302 into 303 for PUT, PATCH and DELETE. Version 3.6 adds QUERY to that list:
if ($response->getStatusCode() === 302 && in_array($request->method(), ['PUT', 'PATCH', 'DELETE'])) {
if ($response->getStatusCode() === 302 && in_array($request->method(), ['PUT', 'PATCH', 'DELETE', 'QUERY'])) { In the lab, an invalid price range (min: 500, max: 100) returned 303, the browser followed it with GET /products, and the page showed the error. Without the fix, the redirect is replayed as QUERY, which the PR notes “usually ends in a 405”.
You can pin it with a test. $this->json() sends Accept: application/json and gets a 422, so send the headers a browser visit would:
it('redirects a failed QUERY search with a 303', function () {
$this->from('/products')->call('QUERY', '/products', server: [
'CONTENT_TYPE' => 'application/json',
'HTTP_ACCEPT' => 'text/html, application/xhtml+xml',
'HTTP_X_INERTIA' => 'true',
], content: json_encode(['price' => ['min' => 500, 'max' => 100]]))
->assertStatus(303)
->assertRedirect('/products');
});Gotcha: the error page has no filters
The redirect lands on a GET page, so it does not carry the QUERY body. The error shows, but the results are unfiltered until the user searches again. Inertia also skips remembering the body when the response has validation errors.
Starting SSR without stopping the others#
inertia:start-ssr always called inertia:stop-ssr first, which sends /shutdown to inertia.ssr.url. With several SSR replicas behind one load balancer, a new instance could shut down a healthy sibling. 3.6 adds an opt-out:
php artisan inertia:start-ssr --no-stop-before-startThe release notes call it --no-stop, but the option in the 3.6.0 source and in --help is --no-stop-before-start.
Gotcha: php artisan serve answers 501#
The first QUERY request in our lab failed before Laravel saw it:
curl -i -X QUERY -H 'Content-Type: application/json' -d '{}' http://127.0.0.1:8000/products
# HTTP/1.1 501 Not Implementedphp artisan serve uses PHP’s built-in web server, and on PHP 8.4 it rejects the method with “Request method not supported”. Sail’s default runtime starts the app with artisan serve too. Your tests still pass (they don’t go through a web server), so you only notice in the browser. Run that curl against your local setup before you build a page on QUERY.
Check your local server in 10 seconds
php artisan route:list --method=QUERY
curl -s -o /dev/null -w "%{http_code}\n" -X QUERY -H 'Content-Type: application/json' -d '{}' http://localhost:8000/products
# 419 or 200 = Laravel got it. 501 = your web server stopped it.Wayfinder and Precognition work together now#
Inertia’s Method type now includes 'query', so the Wayfinder objects from our Wayfinder + Precognition post go straight into Inertia. <Link> and <Form> read the method from the object. With Wayfinder 0.1.23, both lines below sent QUERY {"search":"Acme"} in our lab and passed vue-tsc:
<script setup lang="ts">
import { Link, router } from '@inertiajs/vue3'
import { search } from '@/routes/products'
router.query(search(), { search: 'Acme' })
</script>
<template>
<Link :href="search()" :data="{ search: 'Acme' }">Acme products</Link>
</template>Live validation also works with QUERY. @inertiajs/vue3 3.10 depends on laravel-precognition ^2.1.1, the release that added client.query(). This snippet follows the test pages in the pull request (we didn’t run it):
const form = useForm({ search: '', email: '' }).withPrecognition('query', '/products')
form.validate('search')<Form method="query"> with validate() in its slot works the same way.
Other fixes in 3.10#
Most of the other changes stop old responses from winning a race. If you’ve seen a page “jump back” after a fast click or the Back button, update:
- Stale responses no longer revert navigations (#3344). A poll, deferred prop or partial reload still in flight when you navigate is cancelled instead of putting the old page back.
- Client-side visits cancel in-flight async requests (#3333). Before,
router.push()let them finish, fireonSuccess, and reportcancelled: false. - Visits served from the prefetch cache can be interrupted (#3360) by a newer visit, Back/Forward or
router.cancelAll(). useHttpcancel()hits the right request (#3346). With two overlapping requests, it used to cancel nothing, or the wrong one.- Relative
LinkandFormURLs resolve against the current page (#3358).href="pass"on/a1/a2/a3went to/a1/a2/a1/a2/pass. useHttprespectsforceIndicesArrayFormatInFormDatawith files (#3329), soitems[0][quantity]no longer splits into separate array items in PHP.- The SSR server rejects malformed
/renderrequests with a 400 instead of crashing (#3314). Onecurlto/renderused to stop the process. - Shared
onceprops survive instant visits (#3356), anduseForm(rememberKey, data)acceptsnullorundefinedas the key (#3279). - Smaller ones:
<InfiniteScroll>no longer restores a stale scroll position (#3343), Back no longer saves the wrong scroll position on slow devices (#3348),preserveUrlresets after validation errors (#3332), client visits from a page that cleared history don’t clear it again (#3355), and SSR stylesheet links work on Windows (#3323). - Packaging: the Svelte adapter no longer needs SvelteKit (#3365), and the React adapter lists
@types/reactand@types/react-domas optional peers (#3321).
Upgrade notes#
-
Update both packages. The client sends
QUERY, and the server turns its redirects into303.bashcomposer require inertiajs/inertia-laravel:^3.6 npm install @inertiajs/vue3@^3.10If you use the Vite plugin, update
@inertiajs/viteto 3.10 as well. -
Laravel 13.35 or newer for
Route::query(). See the 13.35 post. -
Check your local web server with the
curlabove.php artisan servereturns 501. -
No breaking changes. Existing
GET/POSTcode is untouched, andQUERYis opt-in per route.
On Inertia 2? Nothing new on the 2.x lines this week (still 2.3.29 and inertia-laravel 2.0.28).
Recap#
router.query(),method="query"on<Link>and<Form>, andquery()onuseFormanduseHttpsend the data in the body.- Reloads, deferred props, polling,
<WhenVisible>and<InfiniteScroll>resend the remembered body. A browser refresh does not. - Update inertia-laravel to 3.6 so failed validation redirects with
303andGET. - In 3.10.0, give
useForma plain copy withtransform()if it has arrays or objects. Don’t test withphp artisan serve.
FAQ#
How do I make a QUERY request with Inertia?
Update to @inertiajs/vue3 3.10, then use router.query(url, data), form.query(url), useHttp().query(url), or method="query" on <Link> and <Form>. The route needs Route::query() (Laravel 13.35+).
Does router.reload() keep the QUERY filters?
Yes. A page rendered by a QUERY visit remembers the body, and reloads, <Deferred>, polling, <WhenVisible> and <InfiniteScroll> send it again. A browser refresh is a plain GET.
Why do I get a 405 or a loop after a failed QUERY validation?
The browser replays a 302 with the same method. inertiajs/inertia-laravel 3.6 turns it into a 303, so the browser follows it with GET.
Why does my QUERY request return 501 locally?
php artisan serve uses PHP's built-in server, which rejected QUERY in our PHP 8.4 lab. Sail's default runtime uses it too. Test with a different local web server.
Should I replace my GET search pages with QUERY?
Only when the filters are too big or nested for a URL. QUERY keeps the URL clean, so searches cannot be bookmarked, shared or restored after a refresh.
Next steps#
- Laravel 13.35: QUERY routes and Markdown responses: the server side of
QUERY. - Wayfinder + Precognition catch up with Laravel’s QUERY routes: typed
.query()helpers and live validation. - Partial reloads in Inertia and Vue: make every reload of a search page cheap.
- Inertia 3.9: background polling and the navigate type: the previous release.
Sources#
- Inertia v3.10.0 release notes
- inertia-laravel v3.6.0 release notes
- PR #3328: support the
QUERYHTTP method - inertia-laravel PR #927:
303afterQUERYredirects - inertia-laravel PR #925: start SSR without stopping first
- laravel/precognition PR #179:
QUERYsupport in the client - laravel/framework PR #61797:
Route::query() - MDN: the QUERY method
- Laravel Sail runtime Dockerfile (PHP 8.4)



