May 2018 Summaries
3 posts from Hasura
Filter
Month:
Year:
Post Summaries
Back to Blog
This article discusses working with schemaless data using GraphQL on Postgres. It explains that schemaless data does not conform to a rigid schema and is usually stored as key-value pairs or JSON documents. The Hasura GraphQL Engine is used for instant GraphQL APIs on Postgres, allowing users to store and retrieve data from tables. The article also covers using Postgres views to filter on JSON data and the limitations of mutation operations on JSON data. It provides an example use case involving a third-party API that provides user information in JSON format and how to store this data in a table with a JSONB column type. Additionally, it demonstrates how to create a view to filter users based on their address pincode and how to insert, fetch, and update JSON data using GraphQL mutations and queries.
May 14, 2018
1,133 words in the original blog post.
This blog post discusses modeling a tree data structure on Postgres using Hasura's GraphQL engine. Tree data structures are commonly used to store hierarchical data such as directory structures, comment threads, and finding common connections in networking applications. The author demonstrates how to create a table for comments with columns for id, parent_id, comment text, created_at timestamp, post_id, and user_id. They also explain how to add a self-reference to the parent_id column and create a relationship to fetch child comments.
The mutation to insert a comment is provided along with an example of adding a reply to a comment. The GraphQL query to fetch comments for a post is demonstrated, including ordering by created_at timestamp. The author also discusses handling unknown levels of nesting in comments and suggests using a separate table to keep track of ancestry or arranging the list of comments in memory on the client side.
Finally, the author concludes by encouraging readers to explore other use-cases for tree data structures and provides resources for getting started with Hasura's GraphQL engine.
May 08, 2018
1,153 words in the original blog post.
This article provides a guide on building location-aware applications using Postgres and GraphQL. It demonstrates how to use Hasura's GraphQL engine for creating GraphQL APIs over Postgres, which is useful in developing backends for such applications. The author explains the process of setting up the Hasura cluster, enabling PostGIS extension on Postgres, creating tables with geographical data, inserting data using GraphQL, and fetching a list of landmarks near a user's location. Additionally, it mentions other utility functions provided by PostGIS that can be used for various purposes.
May 02, 2018
606 words in the original blog post.