Home / Companies / Hasura / Blog / August 2020

August 2020 Summaries

4 posts from Hasura

Filter
Month: Year:
Post Summaries Back to Blog
This tutorial guides developers on how to convert a Ruby on Rails REST API to GraphQL using Hasura Actions. It covers creating a Hasura Cloud project, setting up the action, generating code for the Ruby on Rails server, adding business logic, running the action, and testing the new endpoint. The post also discusses connecting to a database from inside Rails, permissions & relationships, handling existing REST API endpoints, and deploying a Ruby API.
Aug 21, 2020 1,599 words in the original blog post.
This tutorial demonstrates how to convert a Python REST API to GraphQL using Hasura Actions. It involves setting up a Hasura Cloud project and creating an Action with the necessary types and definitions. The process includes generating boilerplate code for a Flask server, defining business logic, and exposing the server on a public URL using ngrok. The tutorial also covers connecting to a database from inside the Flask server, managing permissions and relationships, handling existing REST API endpoints, and supported frameworks.
Aug 14, 2020 1,519 words in the original blog post.
In this post, we discuss how to build a calendar app backend with scheduling logic using Hasura GraphQL and its Scheduled Triggers API. The core functionalities of the app follow an event-driven programming paradigm, involving scheduling one-time and recurring events, inviting users to events, and checking user availability. The main challenge is confirming event scheduling based on availability, sending email reminders/notifications before events begin, and handling changes like modified timestamps. The app's database schema consists of three tables: user, event, and event_attendee. For recurrence patterns, the iCal RFC format is followed. Hasura GraphQL auto-generates CRUD APIs for the app, allowing declarative authorization rules and scheduling events in the future. Data fetching queries required for a calendar app include fetching all events of a user for a given day/week/month/year. Business logic includes validating event scheduling based on availability, sending invitation emails upon event confirmation, and scheduling email or notification reminders before events begin. Scheduled Triggers in Hasura are used to schedule events at specific times. The app uses one-off scheduled events for this purpose. Custom mutations are created using Actions, which allow writing custom business logic without setting up a GraphQL server from scratch. Validations include checking event start and end dates and user availability during the event timeframe. The webhook URL specified during the creation of a scheduled event handles cancellation logic and sends email notifications as part of the app's functionality. Permission rules are configured declaratively, allowing for flexible role-based access control.
Aug 10, 2020 1,570 words in the original blog post.
The text discusses experiments with Arduino and Hasura, focusing on integrating the two platforms for various applications. Arduino is an open-source electronic prototyping platform that supports C & C++ languages, while Johnny-Five is a Javascript robotics & IoT platform. In this post, the author uses Arduino Uno and Johnny-Five to control LEDs based on GraphQL query results from Hasura Cloud. They also demonstrate how to measure room temperature using an LM35 Temperature Sensor connected to an Arduino Uno and push the data to a Hasura Cloud instance every minute for 12 hours. The author suggests other potential applications, such as integrating flame sensors or DIY GPS with Hasura and event triggers.
Aug 05, 2020 622 words in the original blog post.