Closed mgupta83 closed 23 hours ago
This pull request addresses an issue with multiple Apollo clients by updating the Apollo client configuration in the ApolloConnection component and modifying the getMemberById function in the MemberDataApiImpl class. The changes improve the handling of authentication and optimize the database query for retrieving member data.
sequenceDiagram
actor User
participant ApolloConnection
participant ApolloClient
participant ApolloLink
participant HttpLink
participant BatchHttpLink
participant setContext
User->>ApolloConnection: Initialize
ApolloConnection->>setContext: Create withToken context
ApolloConnection->>ApolloLink: Split link based on clientName
ApolloLink->>HttpLink: Use countryLink if clientName is 'country'
ApolloLink->>BatchHttpLink: Use httpLink otherwise
ApolloConnection->>ApolloClient: Set link
ApolloClient->>ApolloConnection: Client ready
ApolloConnection->>User: Provide ApolloProvider with client
classDiagram
class MemberDataApiImpl {
- findOneById(memberId: string): Promise<MemberData>
+ findById(memberId: string): Promise<MemberData>
+ getMemberById(memberId: string): Promise<MemberData>
}
Change | Details | Files |
---|---|---|
Refactored Apollo client configuration in ApolloConnection component |
|
ui-community/src/components/shared/apollo-connection.tsx |
Updated getMemberById function in MemberDataApiImpl class |
|
data-access/src/app/application-services/member/member.data.ts |
This pull request fixes an issue with multiple Apollo clients. The changes include updating the
getMemberById
function in theMemberDataApiImpl
class to use thefindById
method instead offindOneById
. Additionally, theApolloConnection
component now properly sets the Apollo client link based on the client name and includes the necessary dependencies.Summary by Sourcery
Fix the multiple Apollo clients issue by properly setting the Apollo client link based on the client name and updating the
getMemberById
function to usefindById
for better data handling.Bug Fixes:
Enhancements:
getMemberById
function in theMemberDataApiImpl
class to use thefindById
method instead offindOneById
for improved data retrieval.