Skip to content

Commit

Permalink
Merge pull request #2 from alexandrim0/dev
Browse files Browse the repository at this point in the history
- v0.1.0
  • Loading branch information
alexandrim0 authored Dec 20, 2024
2 parents 24eccb3 + ebb8119 commit 1a194db
Show file tree
Hide file tree
Showing 5 changed files with 364 additions and 104 deletions.
1 change: 1 addition & 0 deletions compose.override.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
- "HASURA_GRAPHQL_LOG_LEVEL=debug"
- "HASURA_GRAPHQL_ENABLE_CONSOLE=true"
- "HASURA_GRAPHQL_ENABLE_METADATA_QUERY_LOGGING=true"
- "HASURA_GRAPHQL_CORS_DOMAIN=https://tentura.intersubjective.space, http://localhost:8888"

postgres:
restart: no
Expand Down
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ services:
- 'HASURA_GRAPHQL_INFER_FUNCTION_PERMISSIONS=false'
- 'HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres'
- 'HASURA_GRAPHQL_JWT_SECRET={"type":"Ed25519", "key":"${JWT_PUBLIC_PEM}", "claims_map": {"x-hasura-allowed-roles": ["user", "admin"], "x-hasura-default-role": "user", "x-hasura-user-id": {"path": "$$.sub"}}}'
- 'HASURA_GRAPHQL_EXPERIMENTAL_FEATURES=streaming_subscriptions,remove_empty_subscription_responses'
secrets:
- jwt_public_pem
- hasura_graphql_admin_secret
Expand Down
198 changes: 168 additions & 30 deletions hasura/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource_version": 272,
"resource_version": 393,
"metadata": {
"version": 3,
"sources": [
Expand Down Expand Up @@ -82,16 +82,14 @@
}
},
{
"name": "score",
"name": "scores",
"definition": {
"function": {
"name": "beacon_get_score",
"name": "beacon_get_scores",
"schema": "public"
},
"session_argument": "hasura_session",
"table_argument": "beacon_row"
},
"comment": ""
"session_argument": "hasura_session"
}
}
],
"insert_permissions": [
Expand Down Expand Up @@ -136,8 +134,7 @@
],
"computed_fields": [
"is_pinned",
"my_vote",
"score"
"my_vote"
],
"filter": {}
},
Expand Down Expand Up @@ -285,14 +282,13 @@
}
},
{
"name": "score",
"name": "scores",
"definition": {
"function": {
"name": "comment_get_score",
"name": "comment_get_scores",
"schema": "public"
},
"session_argument": "hasura_session",
"table_argument": "comment_row"
"session_argument": "hasura_session"
}
}
],
Expand Down Expand Up @@ -323,8 +319,7 @@
"id"
],
"computed_fields": [
"my_vote",
"score"
"my_vote"
],
"filter": {}
}
Expand Down Expand Up @@ -410,12 +405,137 @@
}
]
},
{
"table": {
"name": "message",
"schema": "public"
},
"insert_permissions": [
{
"role": "user",
"permission": {
"check": {},
"set": {
"subject": "x-hasura-User-Id"
},
"columns": [
"message",
"object"
]
},
"comment": ""
}
],
"select_permissions": [
{
"role": "user",
"permission": {
"columns": [
"created_at",
"delivered",
"id",
"message",
"object",
"subject",
"updated_at"
],
"filter": {
"_or": [
{
"subject": {
"_eq": "X-Hasura-User-Id"
}
},
{
"object": {
"_eq": "X-Hasura-User-Id"
}
}
]
}
},
"comment": ""
}
],
"update_permissions": [
{
"role": "user",
"permission": {
"columns": [
"delivered"
],
"filter": {
"object": {
"_eq": "X-Hasura-User-Id"
}
},
"check": null,
"set": {
"delivered": "true"
}
},
"comment": ""
}
],
"delete_permissions": [
{
"role": "user",
"permission": {
"filter": {
"_and": [
{
"subject": {
"_eq": "X-Hasura-User-Id"
}
},
{
"delivered": {
"_eq": false
}
}
]
}
},
"comment": ""
}
]
},
{
"table": {
"name": "mutual_score",
"schema": "public"
},
"object_relationships": [
{
"name": "beacon",
"using": {
"manual_configuration": {
"column_mapping": {
"dst": "id"
},
"insertion_order": null,
"remote_table": {
"name": "beacon",
"schema": "public"
}
}
}
},
{
"name": "comment",
"using": {
"manual_configuration": {
"column_mapping": {
"dst": "id"
},
"insertion_order": null,
"remote_table": {
"name": "comment",
"schema": "public"
}
}
}
},
{
"name": "user",
"using": {
Expand Down Expand Up @@ -552,16 +672,14 @@
}
},
{
"name": "score",
"name": "scores",
"definition": {
"function": {
"name": "user_get_score",
"name": "user_get_scores",
"schema": "public"
},
"session_argument": "hasura_session",
"table_argument": "user_row"
},
"comment": ""
"session_argument": "hasura_session"
}
}
],
"select_permissions": [
Expand All @@ -578,8 +696,7 @@
"updated_at"
],
"computed_fields": [
"my_vote",
"score"
"my_vote"
],
"filter": {},
"limit": 10
Expand Down Expand Up @@ -722,7 +839,11 @@
"created_at",
"updated_at"
],
"filter": {}
"filter": {
"subject": {
"_eq": "X-Hasura-User-Id"
}
}
}
}
],
Expand Down Expand Up @@ -788,7 +909,11 @@
"created_at",
"updated_at"
],
"filter": {}
"filter": {
"subject": {
"_eq": "X-Hasura-User-Id"
}
}
}
}
],
Expand Down Expand Up @@ -858,7 +983,11 @@
"created_at",
"updated_at"
],
"filter": {}
"filter": {
"subject": {
"_eq": "X-Hasura-User-Id"
}
}
},
"comment": ""
}
Expand All @@ -879,6 +1008,19 @@
},
"comment": ""
}
],
"delete_permissions": [
{
"role": "user",
"permission": {
"filter": {
"subject": {
"_eq": "X-Hasura-User-Id"
}
}
},
"comment": ""
}
]
}
],
Expand Down Expand Up @@ -933,10 +1075,6 @@
"name": "updates",
"schema": "public"
},
"configuration": {
"custom_root_fields": {},
"session_argument": "hasura_session"
},
"permissions": [
{
"role": "user"
Expand Down
Loading

0 comments on commit 1a194db

Please sign in to comment.