Created
August 22, 2019 05:35
-
-
Save ken0x0a/0265f647900191711736634a0ac783c8 to your computer and use it in GitHub Desktop.
An useful script with HASURA, I was using almost 1 year ago...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!