Skip to content

Conversation

@guendev
Copy link
Owner

@guendev guendev commented Oct 30, 2025

No description provided.

…pollo clients

- Exported `useApolloClients` from the core package.
- Updated README with composables overview and added details for `useApolloClients`.
@guendev guendev self-assigned this Oct 30, 2025
@guendev guendev added the enhancement New feature or request label Oct 30, 2025
@guendev guendev marked this pull request as ready for review October 30, 2025 14:18
Copilot AI review requested due to automatic review settings October 30, 2025 14:19
@guendev guendev merged commit 2e9b5fa into main Oct 30, 2025
7 checks passed
Copy link

Copilot AI left a 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() {
Copy link

Copilot AI Oct 30, 2025

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.

Copilot uses AI. Check for mistakes.
| `useSubscription` | Subscribe to GraphQL streams |
| `useFragment` | Retrieve and manage normalized cache fragments |
| `useApolloClient` | Access current Apollo client |
| `useApolloClients` | Access Apollo clients |
Copy link

Copilot AI Oct 30, 2025

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.

Suggested change
| `useApolloClients` | Access Apollo clients |
| `useApolloClients` | Access all Apollo clients |

Copilot uses AI. Check for mistakes.
| `provideApolloClients` / `useApolloClients` | Manage multiple clients |
| Composable | Description |
|--------------------|------------------------------------------------|
| `useQuery` | Reactive GraphQL query |
Copy link

Copilot AI Oct 30, 2025

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.

Suggested change
| `useQuery` | Reactive GraphQL query |
| `useQuery` | Reactive GraphQL query |
| `useLazyQuery` | Imperative GraphQL query (fetch on demand) |

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants