Skip to content
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

Can't distinguish expired tokens from empty responses #148

Open
1 of 2 tasks
sreuter opened this issue Apr 30, 2018 · 0 comments
Open
1 of 2 tasks

Can't distinguish expired tokens from empty responses #148

sreuter opened this issue Apr 30, 2018 · 0 comments

Comments

@sreuter
Copy link

sreuter commented Apr 30, 2018

Issue type:

I am submitting:

  • an issue
  • a feature request

Issue Questions:

What OS and OS version are you experiencing the issue(s) on?

iOS

What is the expected behavior?

I wanted to implement a custom fetch for my Apollo httpLink to handle expired or soon to be expired idTokens. Unfortunately, whenever a request to graph.cool is made with an expired token, there's nothing distinguishable in the payload I get back that I could use to determine if the request failed because of an expired token.

For the following query, using an expired idToken...

const userQuery = gql`
  query {
    user {
      id,
      name
    }
  }
`;

I get this as result...

{ data: { user: null } }

In this case, I wouldn't be able to tell if the access token expired, or if the user didn't get created before using the createUser() mutation.

What is the actual behavior?

I'd like to be able to distinguish (token expiry) errors from empty responses

What steps may we take to reproduce the behavior?

See "expected behaviour"

@sreuter sreuter changed the title Can't detect token expiry Can't distinguish expired tokens from empty responses Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant