0

I have a vuejs/apollo grapqhl Single page app. At one point there is an option to connect it another service (in this case vimeo). The flow is

  1. click to start - this goes to the graphql server and collects a redirect link to the vimeo oauth2 server with some state attached, then does the redirect
  2. the consent dialog happens on the vimeo oauth2 server, which redirects to a route on the graphql server - this updates the back end database with the vimeo user profile, and then returns to the main front end app where it left off.
  3. at this point I need to refetch the data updated at step 2, but of course I can't detect when this is complete.

Any suggestions as to how to co-erce the front end to refetch when step 3 is complete ?

bruce
  • 1,408
  • 11
  • 33

1 Answers1

0

Actually I figured out how to do this. Just check for the tab coming back into focus using ifvisible, and force a refetch when it does.

  mounted () {
    const that = this
    ifvisible.on('focus', () => that.$apollo.queries.UserProfile.refetch())
  }
bruce
  • 1,408
  • 11
  • 33