AWS Service Orchestration with GraphQL and Hasura Cloud

Create a Hasura Cloud Project

Create AWS RDS PostgreSQL

Setting up Amazon Cognito

Add Custom JWT Claims for Hasura

exports.handler = (event, context, callback) => { event.response = { "claimsOverrideDetails": { "claimsToAddOrOverride": { "https://hasura.io/jwt/claims": JSON.stringify({ "x-hasura-user-id": event.request.userAttributes.sub, "x-hasura-default-role": "user", // do some custom logic to decide allowed roles "x-hasura-allowed-roles": ["user"], }) } } } callback(null, event) }

Configure Hasura Cloud ENV

{ "type":"RS256", "jwk_url": "https://cognito-idp.<aws-region>.amazonaws.com/<user-pool-id>/.well-known/jwks.json", "claims_format": "stringified_json" }

Create permissions for the role user

Set up Lambda for Hasura Events

--

--

⚡️ Instant realtime GraphQL APIs! Connect Hasura to your database & data sources (GraphQL, REST & 3rd party API) and get a unified data access layer instantly.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store