# Add a query string to a Wayfinder URL

> Pass query on the generated Wayfinder function. Do not glue a question mark onto the URL by hand.

- URL: https://laravel-vuejs.space/wayfinder-query-string-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, TypeScript

People searching “Wayfinder query string” concatenate `?search=` onto a generated URL and then lose the types. The [Wayfinder guide](https://laravel-vuejs.space/laravel-wayfinder-vue) shows `store()` for a form. A list link is the same generated function, plus the query object the file already accepts.

> **TL;DR**
>
> -   Pass query on the generated Wayfinder function.
> -   Do not glue a question mark onto the URL by hand.
> -   Do not install Ziggy because a query string felt easier with `route()`.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3 · TypeScript

## The fix

Open `resources/js/actions/.../PostController.ts` after `php artisan wayfinder:generate`. The `index` function takes an options argument. This is the shape current Wayfinder generates for a route with no parameters:

```vue
<script setup lang="ts">
import { Link } from "@inertiajs/vue3";
import { index } from "@/actions/App/Http/Controllers/PostController";

defineProps<{ search: string }>();
</script>

<template>
  <Link :href="index({ query: { search } })">Search</Link>
</template>
```

If the generated type names the argument differently, follow the file. The generator is the API. An action that already has a route parameter takes that parameter first and the options second, the same way the [Wayfinder guide](https://laravel-vuejs.space/laravel-wayfinder-vue) uses `update(post.id)`.

## What to avoid

> **Gotcha**
>
> Do not install Ziggy because a query string felt easier with `route()`. The [Ziggy page](https://laravel-vuejs.space/laravel-ziggy-vue) is why that package stays out of this kit.

## FAQ

**Q: How do I add a query string to a Wayfinder URL?**

Pass query on the generated Wayfinder function. Do not glue a question mark onto the URL by hand.

**Q: What goes wrong with Wayfinder query string?**

Many developers concatenate `?search=` onto a generated URL and then lose the types. Do not install Ziggy because a query string felt easier with `route()`.
