-
Notifications
You must be signed in to change notification settings - Fork 0
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
HPC-9578 Add Apollo Client #462
base: HPC-9502
Are you sure you want to change the base?
Conversation
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Checks have passed and this pull request is ready for manual review
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.
Everything looks good!
We'll need to rebase this branch with all the new work and previously merged work too.
The only thing pending is to do a pair session with you to review the functionality and next steps to do (such as what can do Apollo Server to help to reduce the payload or to maintain the same data structure/schema)
Nature of PR
Description
Add Apollo client to make calls to GrapQL endpoints. Beside setting up Apollo client I added an
AbortSignal
for calls that are using our REST endpoints, like this when changing of page the petition gets cancelled.Out of the box Apollo will let us have a cache system, that's why I remove the abort signals from petitions using it, once they are made they will not repeat themselves and they will be accessed form the cache.
Apollo allow use to use their own hooks like
useQuery
, but since we have already implemented in the project our owndataLoader
I was not sure what would be the best idea. Also, reusing ourdataLoader
makes the implementation easier with less changes.How to test changes
To test changes I feel the key places to look are:
model.ts
I added Apollo client here and we should double check that this should be the place where it belongs, if it's not the case we need to see where would that be.TODO:
Maybe we could investigate what else could we do with Apollo Client, there is a TODO comment in the code that we could look into:
And I suppose Apollo offers some kind of solution for this. In any case, if we feel is the case we could open a ticket in the future.