Skip to content

Conversation

@rossbulat
Copy link
Collaborator

@rossbulat rossbulat commented Dec 23, 2025

This PR migrates the codebase from Apollo Client v3 to v4, introducing significant changes to the GraphQL client implementation and query patterns.

Key Changes

  • Upgraded @apollo/client from v3.13.9 to v4.0.11 with new peer dependency on rxjs v7.8.2
  • Refactored type system with new QueryReturn<T> type that guarantees non-null data through default values
  • Updated all query hooks to use type parameters and return default values instead of null/undefined
  • Changed Apollo Client initialization to use explicit HttpLink instead of uri shorthand

Copy link
Contributor

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 PR migrates the codebase from Apollo Client v3 to v4, introducing significant changes to the GraphQL client implementation and query patterns.

Key Changes

  • Upgraded @apollo/client from v3.13.9 to v4.0.11 with new peer dependency on rxjs v7.8.2
  • Refactored type system with new QueryReturn<T> type that guarantees non-null data through default values
  • Updated all query hooks to use type parameters and return default values instead of null/undefined
  • Changed Apollo Client initialization to use explicit HttpLink instead of uri shorthand

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Updates Apollo Client package from v3.14.0 to v4.0.11, adds rxjs dependency, removes deprecated dependencies (hoist-non-react-statics, prop-types, react-is@16, rehackt, symbol-observable, ts-invariant, zen-observable)
packages/plugin-staking-api/package.json Updates Apollo Client dependency specification to ^4.0.11 and adds rxjs ^7.8.2
packages/plugin-staking-api/src/types.ts Introduces QueryReturn type for v4, imports ApolloError from v4-migration package, refactors all Result types to Data types with flattened structure
packages/plugin-staking-api/src/Client.ts Replaces uri shorthand with explicit HttpLink configuration
packages/plugin-staking-api/src/index.ts Updates ApolloProvider import to @apollo/client/react, removes isActiveStaker export
packages/plugin-staking-api/src/queries/*.ts Standardizes query pattern: imports useQuery from @apollo/client/react, adds DEFAULT constants, updates return types to use QueryReturn, uses type parameters in useQuery calls
packages/app/src/**/*.tsx Updates consumer code to destructure new data structure, adjusts null handling patterns
packages/global-bus/src/networkConfig/util.ts Updates type reference from RpcEndpointChainHealth to RpcEndpointHealthData and adjusts property access pattern
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rossbulat rossbulat merged commit 5237c99 into main Dec 23, 2025
3 checks passed
@rossbulat rossbulat deleted the rb/apollo-4-migration branch December 23, 2025 08:00
@github-project-automation github-project-automation bot moved this from ✂️ In progress to ✅ Done in Staking Dashboard 2.x Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants