Repository navigation
Conversation
👷 Deploy request for apollo-module pending review.Visit the deploys page to approve it
|
onmax
force-pushed
the
perf/options-api-opt-out
branch
from
October 30, 2026 06:28
612de44 to
f3642e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
None. Related to #575, which added Options API support.
❓ Type of change
📚 Description
The plugin always installs
@vue/apollo-option. Its global mixin runs on every component, even in apps that only use composables. In SSR itsserverPrefetchhook makes every component render async, souseId()values get longer at each level:This adds
apollo.optionsApi. It defaults totrue, so nothing changes for existing apps. Set it tofalseto skip the provider. Composables keep working. Theapollocomponent option needs the provider, and without itthis.$apollois the plain{ clients, defaultClient }object fromuseNuxtApp().$apollo, sothis.$apollo.query()is gone.I tried it on a Nuxt UI app with no Options API queries. With
false, the HTML stays the same apart from the ids, pages are 2 to 5% smaller, and the server no longer runs@vue/apollo-option. CPU was mixed. One page got 13% faster, and a page with a big table got 6% slower, which I can't explain yet.v5has no tests, so the second commit adds vitest and@nuxt/test-utils, with tests for both settings and for the composables withoptionsApi: false. Runpnpm dev:prepare, thenpnpm test. I can drop that commit if you'd rather not have it.