⚠️ This lesson is retired and might contain outdated information.

Querying Data in Hasura

Ali Spittel
InstructorAli Spittel
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 2 years ago

In this video, we run a SQL query and a GraphQL query and mutation in Hasura, demonstrating the multiple ways you can access data.

Ali Spittel: [0:00] Now that we have data loaded into our database, we can write some queries to see that data.

[0:06] If you go over to the DATA tab and then click SQL, you can write normal SQL queries. I could do SELECT * FROM "users" and then click Run and see all the users that I have loaded into my database. This is helpful if you want to insert a lot of data into your database. You could do a SQL query to insert data from a CSV or something along those lines.

[0:32] You can also head over to the GraphiQL tab and write some GraphiQL queries. I'm going to use the Explorer tool to get all the users and their id and their username back. You can see that now I have both of my users.

[0:53] We can also write mutations using this GraphiQL Explorer. If you switch over to mutation here, then click that + button, you'll get all the information about creating a mutation. Using this mutation, I can insert one user into the database named "aspit." Then I'll get the username and id back.

[1:14] Hasura allows us to access and manipulate our data in multiple ways, which allows you to write multiple different types of queries.

egghead
egghead
~ 11 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today