Description
Intro
Hasura GraphQL Engine is an open-source realtime GraphQL API layer which can be put over any Postgres database (new or existing). Along with instant GraphQL APIs, the Hasura GraphQL Engine also provides two features for writing custom logic for your app:
Remote Schemas: Integrate any external GraphQL service with Hasura to provide a merged GraphQL API.
Event Triggers: Trigger a webhook on any action (Insert, Update, Delete) on the database.
With Remote Schemas, you can extend Hasura with additional APIs for performing sync actions for e.g. checkAndAddUser
to make custom validations before inserting a user. With Event Triggers, you can perform aysnc actions for e.g. sendEmail
after a user is inserted. Combining both these features allows you to build complex applications easily.
To get started with Remote Schemas or Event Triggers, developers can use one of our boilerplates from here: https://github.com/hasura/graphql-engine/tree/master/community/boilerplates
Currently, the boilerplates are available for major cloud providers (AWS, GCP, Azure) in NodeJS. We want to add other infrastructure providers and languages to this repository. Check the next section for more detailed requirements.
Requirements
You can write any of two types of boilerplates:
- Base boilerplates
- Use-case boilerplates
Base boilerplates
Base boilerplates are “Hello World” type boilerplates which has the scaffolding to get started with a minimal example.
For Remote Schemas, it is a GraphQL server with a “hello” query, ref: https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/remote-schemas/aws-lambda/nodejs
For Event Triggers, it is a function which simply “echoes” the input, ref:
https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/event-triggers/aws-lambda/nodejs8/echo
Use-case boilerplates
Use-case boilerplates are common examples of real-world tasks.
For Remote Schemas, for e.g., it could be “Validate User Before Insert” or “Check Inventory Before Placing Order” GraphQL APIs. This would typically involve modeling the database and then using the types generated by Hasura GraphQL Engine in your remote schema.
For Event Triggers, for e.g., it could be “Send Email” on user creation or “Creating a data pipeline” on ingest of data. This would typically involve modeling the database.
Infra Providers
We are looking for boilerplates for providers like AWS Lambda, Google Cloud Functions, Azure Functions, Zeit, Heroku, Dokku, Kubernetes or any other app deployment platform which is fairly popular.
Languages
We are looking for boilerplates for languages like NodeJS, Go, Python, Ruby, Java, .NET. Please keep in mind that these boilerplates would be used by thousands of developers so the code should be idiomatic and production-ready.
Please make sure your boilerplate is not conflicting with what is already available here: https://github.com/hasura/graphql-engine/tree/master/community/boilerplates
Deliverables
You should send a PR with the boilerplate code, a complete README with local development and deployment instructions. Here is a sample: de12f25
The use-case boilerplate should also be accompanied by a short blogspot which explains the use-case and the approach taken. Contributing a use-case boilerplate + blogpost will also make you eligible for the Hasura Technical Writer Program.
Getting Started
If you are in, just comment on this issue with what you plan to do and we will create a separate issue for the same.
For any doubts, pls feel free to contact @Tiru#9339
on Discord (https://discord.gg/hasura) .