-
Notifications
You must be signed in to change notification settings - Fork 1
feat(core): add useApolloClients composable for managing multiple Apollo clients
#37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pollo clients - Exported `useApolloClients` from the core package. - Updated README with composables overview and added details for `useApolloClients`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds a new useApolloClients() composable that provides direct access to all Apollo client instances in the registry. The composable complements the existing useApolloClient() function which retrieves a single client by ID.
- Implements
useApolloClients()composable to return all registered Apollo clients - Adds auto-import support for the new composable in the Nuxt module
- Updates documentation to reference the new composable
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/composables/useApolloClients.ts | New composable implementation with JSDoc documentation |
| packages/core/src/index.ts | Exports the new useApolloClients composable |
| packages/nuxt/src/module.ts | Adds useApolloClients to auto-imports list |
| packages/docs/composables/useApolloClient.md | Adds reference to useApolloClients |
| packages/core/README.md | Updates composables overview table with useApolloClients |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * }) | ||
| * ``` | ||
| */ | ||
| export function useApolloClients() { |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is missing an explicit return type annotation. Add : Record<string, ApolloClient<any>> to match the type from APOLLO_CLIENTS_KEY and improve type safety.
| | `useSubscription` | Subscribe to GraphQL streams | | ||
| | `useFragment` | Retrieve and manage normalized cache fragments | | ||
| | `useApolloClient` | Access current Apollo client | | ||
| | `useApolloClients` | Access Apollo clients | |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description 'Access Apollo clients' is inconsistent with useApolloClient's description. Consider 'Access all Apollo clients' to clarify that this composable returns all clients, not just one.
| | `useApolloClients` | Access Apollo clients | | |
| | `useApolloClients` | Access all Apollo clients | |
| | `provideApolloClients` / `useApolloClients` | Manage multiple clients | | ||
| | Composable | Description | | ||
| |--------------------|------------------------------------------------| | ||
| | `useQuery` | Reactive GraphQL query | |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table removed useLazyQuery which was present in the original version. If this composable still exists in the codebase, it should remain in the documentation table.
| | `useQuery` | Reactive GraphQL query | | |
| | `useQuery` | Reactive GraphQL query | | |
| | `useLazyQuery` | Imperative GraphQL query (fetch on demand) | |
No description provided.