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

Data is Null in query #4111

Closed
japrogramer opened this issue Nov 7, 2018 · 2 comments
Closed

Data is Null in query #4111

japrogramer opened this issue Nov 7, 2018 · 2 comments
Labels
🚧 in-triage Issue currently being triaged

Comments

@japrogramer
Copy link

japrogramer commented Nov 7, 2018

Intended outcome:
I expected data to be something even if loading or an error occoured

Actual outcome:
data seems to be null

How to reproduce the issue:

<Query
query={EmailFromTokenQuery}
variables={{ token: context.token }}
skip={ready}
>
{({ data }) => {
  if (data == null) return null;
  if (data.loading) return null;
  if (data.error) return `Error!: ${data.error}`;
  if (data.invitationByToken && !ready){
    const set_email = context.Change('email');
    this.setState({ready: true},
    () => set_email({target: {value: data.invitationByToken.invitee}})
    );
  }
  return null;
}}
</Query>


Versions

System:
OS: Linux 4.18 Arch Linux undefined
Binaries:
Node: 8.11.2 - ~/.nvm/versions/node/v8.11.2/bin/node
Yarn: 1.7.0 - ~/.nvm/versions/node/v8.11.2/bin/yarn
npm: 3.10.10 - ~/Code/work/sixnexus/frontclient/node_modules/.bin/npm
Browsers:
Firefox: 63.0.1
npmPackages:
apollo-boost: ^0.1.10 => 0.1.20
apollo-link-ws: ^1.0.8 => 1.0.9
react-apollo: ^2.1.9 => 2.2.4

@OurMajesty
Copy link

It was fixed in react-apollo, but was reverted because of Typescript issues.
apollographql/react-apollo#1983

@hwillson hwillson added the 🚧 in-triage Issue currently being triaged label Jul 9, 2019
@hwillson
Copy link
Member

hwillson commented Jul 9, 2019

This should no longer be an issue using current versions of apollo-client / react-apollo. Thanks!

@hwillson hwillson closed this as completed Jul 9, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚧 in-triage Issue currently being triaged
Projects
None yet
Development

No branches or pull requests

3 participants