Created
July 24, 2022 02:48
-
-
Save ChronSyn/1e3b79f0deb822944cad8328fa97cdb3 to your computer and use it in GitHub Desktop.
Hasura - allow only select access to root queries
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
# SourceNameGoesHere = the name as it appears in Hasura dashboard | |
# See example: https://twitter.com/ChronSyn/status/1551035751512657921/photo/1 | |
curl --location --request POST 'https://[your-hasura-address-dot-com]/v1/metadata' \ | |
--header 'x-hasura-admin-secret: <your hasura admin secret>' \ | |
--header 'X-Hasura-Role: admin' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw '{ | |
"type" : "pg_create_select_permission", | |
"args" : { | |
"table" : { | |
"name": "name_of_your_table", | |
"schema": "schema_of_your_table" | |
}, | |
"role" : "public", | |
"source": "SourceNameGoesHere", | |
"permission" : { | |
"columns" : "*", | |
"filter" : {}, | |
"query_root_fields": ["select"], | |
"subscription_root_fields": [] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment