Skip to content

fix(client): remove isVue from @orval/core#3630

Merged
melloware merged 1 commit into
orval-labs:masterfrom
daugvinasr:refactor/remove-isvue-from-core-options
Jun 20, 2026
Merged

fix(client): remove isVue from @orval/core#3630
melloware merged 1 commit into
orval-labs:masterfrom
daugvinasr:refactor/remove-isvue-from-core-options

Conversation

@daugvinasr

@daugvinasr daugvinasr commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Removes isVue from @orval/core. Old Vue hook-mutator path unref'd only the query params (via core's inline unref) and never unref'd path params. Fixed the issue and added spec to cover this case. Also most of the places now no longer double unref.

KBHkwi0c

Summary by CodeRabbit

  • New Features

    • Enhanced Angular query parameter filtering in generated code with new shared helper utilities.
    • Added Vue Query hook mutator test infrastructure and configuration.
  • Refactor

    • Removed Vue-specific option handling from core generators.
    • Simplified parameter passing in generated client code for improved clarity.
  • Tests

    • Added new test mutator and OpenAPI specification for Vue Query hook scenarios.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 25570a8a-a5f0-4b66-b34c-3bfa9f94c9ba

📥 Commits

Reviewing files that changed from the base of the PR and between 5e49152 and 3c6832d.

⛔ Files ignored due to path filters (11)
  • samples/vue-query/vue-query-basic/__snapshots__/endpoints/petstoreFromFileSpecWithTransformer.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/hook-mutator/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/hook-mutator/model/getProductParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/hook-mutator/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/hook-mutator/model/product.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/mutator/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/petstore-tags-split/pets/pets.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/petstore/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/split/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/tags/pets.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/vue-query/zod-schema-response/endpoints.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (7)
  • packages/core/src/generators/options.test.ts
  • packages/core/src/generators/options.ts
  • packages/query/src/client.ts
  • samples/vue-query/vue-query-basic/src/api/endpoints/petstoreFromFileSpecWithTransformer.ts
  • tests/configs/vue-query.config.ts
  • tests/mutators/use-custom-instance-vue.ts
  • tests/specifications/vue-query-hook-mutator.yaml
💤 Files with no reviewable changes (1)
  • packages/core/src/generators/options.test.ts

📝 Walkthrough

Walkthrough

The PR replaces isVue with isAngular across options generator interfaces (GenerateAxiosOptions, GenerateOptionsOptions, GenerateMutatorConfigOptions, generateQueryParamsAxiosConfig) and their callers, removes the Vue-specific unref(params) branch from query-param composition, refactors the isHook template-building logic in the Axios client, and adds a new Vue hook-mutator end-to-end test fixture (OpenAPI spec, composable mutator, Orval config).

Changes

isVue → isAngular Option Flag Removal and Vue unref Cleanup

Layer / File(s) Summary
Interface and signature updates: isVue → isAngular
packages/core/src/generators/options.ts
GenerateAxiosOptions, GenerateOptionsOptions, GenerateMutatorConfigOptions replace the isVue field with isAngular; generateAxiosOptions, generateOptions, generateQueryParamsAxiosConfig, and generateMutatorConfig parameter destructuring updated to match.
Remove Vue unref(params) branch; wire Angular-only path
packages/core/src/generators/options.ts
In generateAxiosOptions the Vue params branch is dropped; generateQueryParamsAxiosConfig removes the Vue unref path and keeps only buildAngularParamsFilterExpression; downstream calls in generateMutatorConfig and generateOptions forward isAngular ?? false.
Axios client caller updates and hook template refactor
packages/query/src/client.ts
generateAngularHttpRequestFunction and generateAxiosRequestFunction drop isVue from generateMutatorConfig and generateOptions calls; the mutator.isHook branch is rewritten from split ret/vueRet templates to a single callback with a Vue/non-Vue useCallback conditional.
Tests: remove isVue: false from generateAxiosOptions call sites
packages/core/src/generators/options.test.ts
Fifteen test cases remove isVue: false from their generateAxiosOptions argument objects; assertions are unchanged.
Sample: params shorthand replacing params: unref(params)
samples/vue-query/vue-query-basic/src/api/endpoints/petstoreFromFileSpecWithTransformer.ts
listPets switches from params: unref(params) to the params shorthand, reflecting the removed Vue unref path.

New Vue Hook-Mutator End-to-End Test Fixture

Layer / File(s) Summary
New OpenAPI spec and Vue composable mutator
tests/specifications/vue-query-hook-mutator.yaml, tests/mutators/use-custom-instance-vue.ts
Adds an OpenAPI 3.0.4 spec for GET /api/v{version}/product/{productId} with path/query params and Product schema; adds useCustomInstance composable that wraps Axios via useQueryClient and resolves only data.
Orval hookMutator config entry
tests/configs/vue-query.config.ts
Adds the hookMutator Orval config block pointing at the new spec, Vue Query + axios client, and the useCustomInstance mutator override.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • orval-labs/orval#3196: Directly consumes the shared Angular filtered-params helpers introduced in this PR (getAngularFilteredParamsExpression, getAngularFilteredParamsCallExpression) for Angular http-client query-param wiring.
  • orval-labs/orval#3386: Also touches Vue-generated query-param handling around unref(...), updating Vue adapter/infinite-query HTTP props to unref MaybeRef params for fetch/custom clients.

Suggested labels

vue, tanstack-query

Suggested reviewers

  • snebjorn
  • melloware

Poem

🐇 Hoppity-hop through the code I go,
isVue is out, isAngular steals the show!
No more unref in the params chain,
A single callback cleans up the refrain.
New fixtures planted, the test garden grows —
This bunny approves of how cleanly it flows! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: removing the isVue configuration option from @orval/core. This is the central refactoring theme across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@daugvinasr daugvinasr force-pushed the refactor/remove-isvue-from-core-options branch 3 times, most recently from 9d1a408 to d0281f8 Compare June 20, 2026 07:14
@daugvinasr daugvinasr force-pushed the refactor/remove-isvue-from-core-options branch from d0281f8 to 3c6832d Compare June 20, 2026 07:29
@daugvinasr daugvinasr changed the title fix(client): remove double unref fix(client): removes isVue from @orval/core Jun 20, 2026
@daugvinasr daugvinasr changed the title fix(client): removes isVue from @orval/core fix(client): remove isVue from @orval/core Jun 20, 2026
@daugvinasr daugvinasr marked this pull request as ready for review June 20, 2026 07:46
@melloware melloware linked an issue Jun 20, 2026 that may be closed by this pull request
@melloware melloware added the vue Vue related issue label Jun 20, 2026
@melloware melloware merged commit 101cade into orval-labs:master Jun 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vue Vue related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vue-query: support MaybeRefOrGetter for generated hook parameters

2 participants