Skip to content

Instantly share code, notes, and snippets.

@dxlbnl
Created November 17, 2018 18:33
Show Gist options
  • Save dxlbnl/c03d3bb53bbda465498bc22182ae042a to your computer and use it in GitHub Desktop.
Save dxlbnl/c03d3bb53bbda465498bc22182ae042a to your computer and use it in GitHub Desktop.
Hasura error with GENERATED ALWAYS
graphql_1 | {
"timestamp": "2018-11-17T18:09:55.628+0000",
"level": "info",
"type": "http-log",
"detail": {
"status": 500,
"query_hash": "cb9097259d9674a46228be3b19979abd7f46b6aa",
"http_version": "HTTP/1.1",
"query_execution_time": 0.014521827,
"request_id": null,
"url": "/v1alpha1/graphql",
"ip": "172.19.0.1",
"response_size": 1166,
"user": {
"x-hasura-role": "login",
"x-hasura-user-id": "-1"
},
"method": "POST",
"detail": {
"error": {
"internal": {
"statement": "WITH \"public_user__mutation_result_alias\" AS (INSERT INTO \"hdb_views\".\"login__insert__public__user\" ( \"email\", \"created\", \"username\", \"modified\", \"password\", \"emailverified\", \"id\" ) VALUES ( $1, DEFAULT, $2, DEFAULT, DEFAULT, $3, DEFAULT ) RETURNING * ) SELECT json_build_object('response', (SELECT coalesce((json_agg(\"root\" )->0), 'null' ) AS \"root\" FROM (SELECT row_to_json((SELECT \"_1_e\" FROM (SELECT \"_0_root.base\".\"id\" AS \"id\" ) AS \"_1_e\" ) ) AS \"root\" FROM (SELECT * FROM \"public_user__mutation_result_alias\" WHERE ('true') ) AS \"_0_root.base\" ) AS \"_2_root\" ) ) ",
"prepared": true,
"error": {
"exec_status": "FatalError",
"hint": "Use OVERRIDING SYSTEM VALUE to override.",
"message": "cannot insert into column \"id\"",
"status_code": "428C9",
"description": "Column \"id\" is an identity column defined as GENERATED ALWAYS."
},
"arguments": [
"(Oid 25,Just (\"email@bla.com\",Binary))",
"(Oid 25,Just (\"un\",Binary))",
"(Oid 16,Just (\"\\SOH\",Binary))"
]
},
"path": "$.selectionSet.insert_user.args.objects[0]",
"error": "postgres query error",
"code": "postgres-error"
},
"request": "{\"query\":\"mutation($email:String, $username:String, $access_token:String, $facebook_id:String) {\\n\\tinsert_user(objects:{\\n email: $email,\\n username:$username,\\n emailverified:true,\\n facebook_tokens: {\\n data: {\\n access_token:$access_token,\\n facebook_id:$facebook_id\\n }\\n }\\n }) {\\n returning {\\n id\\n }\\n\\t}\\n}\",\"variables\":{\"email\":\"email@bla.com\",\"username\":\"un\",\"access_token\":\"Testing\",\"facebook_id\":\"123\"}}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment