This is an example of how to implement the process to refresh a token when the token is invalid in Apollo GraphQL.
You can reference the detail in my post "React Apollo: JWT & Refresh Token" on Dev.to.
There is another implementation for the refreshing token process used Link
. Check this out in the link
branch.