Skip to content

Instantly share code, notes, and snippets.

@ken0x0a
Created August 22, 2019 05:35
Show Gist options
  • Save ken0x0a/0265f647900191711736634a0ac783c8 to your computer and use it in GitHub Desktop.
Save ken0x0a/0265f647900191711736634a0ac783c8 to your computer and use it in GitHub Desktop.
An useful script with HASURA, I was using almost 1 year ago...
#! /bin/bash
#
# 1. Update schema @ HASURA
#
curl -d \
'{
"type": "reload_metadata",
"args": {}
}' \
-H "Content-Type: application/json" \
-H 'X-Hasura-Access-Key: YOUR_KEY_HERE' \
-X POST http://localhost:8989/v1/query
# 2. Get schema
gq http://localhost:8989/v1alpha1/graphql -H 'X-Hasura-Access-Key: YOUR_KEY_HERE' --introspect > schema.graphql
# 3. Generate typescript
yarn gql-gen
@ken0x0a
Copy link
Author

ken0x0a commented Aug 22, 2019

As it was quite difficult to update schema from sql, if I use Hasura, currently I'm using PostGraphile and my knowledge of Hasura must be outdated.

PostGraphile is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment