Learn how to build a working real-time backend for a to-do app using Hasura and GraphQL.
Have you tried Hasura and GraphQL before?
How was your experience?
Let us know in the comments
Do you all have a link to the version of the sample app running in the live demo?
Seems like its been updated on the hasura repo so when we git clone it, I am not getting the same results. Thanks.
What is the practice using id token vs access token for hasura access?
Sorry for the delayed reply. Iāll be investigating this question and will provide you an answer as soon as possible. Thank you for reading our blog and for joining our community!
Thank you for reading the blog post and for joining our community!
I apologize for the delayed reply. Let me bring up this question internally and communicate with the Hasura team. I will provide you an answer as soon as possible.
I checked with my team and I got an answer for you The app wasnāt created specifically for the blog post. The blog post refers to a sample that Hasura has in their monorepo.
You can checkout out a commit that reflects the state of the app at the time the post was made as follows:
git clone git@github.com:hasura/graphql-engine.git
cd graphql-engine/community/sample-apps/react-apollo-todo
git checkout f9fc0cc5e30644eaa73dc6507c52f0ebbb82af2e
Thank you for your time. Let me know if this works out well for you!
You can use either an ID token or Access token as long as itās a JWT and contains the required Hasura claims. However, when the client is calling an API, you should use an access token. Hereās a document that can further explain this reasoning:
Let me know if you have any further questions, please
In the example While creating view
CREATE OR REPLACE VIEW āpublicā.āonline_usersā AS
SELECT users.name, users.last_seen
FROM users
WHERE (users.last_seen >= (now() - ā00:00:30ā::interval));
Getting error
SQL Execution Failed
postgres-error : syntax error at or near ā.ā
Can you please help.
Hey there @kiran!
Iām sure @dan-auth0 will do his best to help you once heās online! Thank you!
Howdy, Kiran!
Is this for the client demo app that is provided in the blog post?
@dan-auth0: yes this is for the client demo app.
Thank you, Kiran. I will raise the issue internally. Thatās code thatās owned and controlled by the Hasura team. Iāll see if they can provide an update on this. Did it also fail when checking out the specified commit?
We plan to update this content with our own demo in the future but I donāt have an ETA yet. Please stay tuned.
@dan-auth0 Thanks for the responseā¦
Weāll let you know @kiran once we have it!
Iāve spun up the tutorial but after logging in, Iām seeing SameSite warnings:
A cookie associated with a cross-site resource at http://auth0.com/ was set without the `SameSite` attribute. It has been blocked...
When I refresh the page, it seems to lose my log-in (because no cookie?) and displays errors:
Uncaught (in promise) Error: GraphQL error: Missing Authorization header in JWT authentication mode
at new ApolloError (bundle.esm.js:63)...
Any attempt to then add a Todo item results in a JS alert (āSomething went wrongā).
Iām running the f9fc branch (git checkout f9fc0cc5e30644eaa73dc6507c52f0ebbb82af2e
) although I did try pulling tag v1.2.2 in case it has been patched.
@dan-auth0 Any news on your āown demoā that you mentioned a couple of months back please? Iām evaluating Hasura and Iād really like to get a React sample running before committing my project to it.
Hello, Alex. Welcome to the Auth0 Community
Let me reach out to check on the status of that, please
Let me also raise the issue you are reporting internally.
Hey @dan-auth0 . Could I please get an update on this please? Itās on the critical path for my project and Iāve been stalled for 2 weeks. A working sample would really help me out. Cheers.
Alex, apologies for the delay. The content is in progress. From the update I just saw, the authorization part is in the last stage of review. I am confirming if weāll have a sample that integrates with React ready with it.
Hi @dan-auth0,
Any news with the āError: GraphQL error: Missing Authorization header in JWT authentication modeā issue? Experiencing the same behaviour.
Thanks!