-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
c/serverRelated to serverRelated to serverk/bugSomething isn't workingSomething isn't workingp/highcandidate for being included in the upcoming sprintcandidate for being included in the upcoming sprint
Description
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.insert_a.args.objects[0]",
"code": "constraint-violation"
},
"message": "Not-NULL violation. null value in column \"id\" violates not-null constraint"
}
]
}The following table definitions reproduce the above error:
Tables
Table a:
Table B:
Relationships
Table A:
Table B:
Invoking The Error
That error happens when inserting data from the "has one" side (table a), but not when inserting from the "belongs to" side (I wish Hasura could label relationships like this as well in addition to what's there to make things clear quickly):
the above error happens when you run this query:
mutation {
insert_a(objects: {
junk_a: "This is a's junk"
b:{
data:
{
junk_b: "B's junk inserted when inserting a's junk"
}
}
}){
affected_rows
}
}but not when you run this query from the other side:
mutation {
insert_b(objects: {
junk_b: "This is B's junk"
a:{
data:
{
junk_a: "A's junk inserted when inserting B's junk"
}
}
}){
affected_rows
}
}This could be related to #2508, but I am not sure cause what he is reporting on is different.
vantaka2, erichiller, afitzek, mostlymetalman, corsali-albert and 3 more
Metadata
Metadata
Assignees
Labels
c/serverRelated to serverRelated to serverk/bugSomething isn't workingSomething isn't workingp/highcandidate for being included in the upcoming sprintcandidate for being included in the upcoming sprint