Looks like you don't have the user field set up on posts type. You have user_id so how would you return the name and avatar from the users table?
users
this query doesnt work if i have the same set up as you:
query getPosts { posts { title cover_img content created_at user { name avatar_url } } }
Solution is tracking the foreign keys on your tables. See:docs.hasura.io/1.0/graphql/manual/...
Not exactly. an easier solution is what I wrote. You need to add relationships in relationships tab. I added a screenshot to clarify
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Looks like you don't have the user field set up on posts type. You have user_id so how would you return the name and avatar from the
users
table?this query doesnt work if i have the same set up as you:
Solution is tracking the foreign keys on your tables. See:docs.hasura.io/1.0/graphql/manual/...
Not exactly. an easier solution is what I wrote. You need to add relationships in relationships tab. I added a screenshot to clarify