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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

'data' is not defined #13

Closed
mariusflorescu opened this issue Nov 4, 2020 · 1 comment
Closed

'data' is not defined #13

mariusflorescu opened this issue Nov 4, 2020 · 1 comment

Comments

@mariusflorescu
Copy link

mariusflorescu commented Nov 4, 2020

- Issue located in: /client/src/pages/Home

const {
    loading,
    data: { getPosts: posts }
  } = useQuery(FETCH_POSTS_QUERY);

-Issue description: 'data' is not defined (twice) 馃槩

-Context: I think the problem is due to the migration to @apollo/client 3.0 (they've discussed something about some changes regarding loading / data)

-How I solved it: :

const{
    loading,
    data={}
  } = useQuery(FETCH_POSTS_QUERY);

const posts = data.getPosts;
@aindriu80
Copy link

I was having this same problem 侃(汀喙徧∴箯)鄱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants