Forum Discussion
Fabric GraphQl - How to create multiple record under single mutation.
- 1 year ago
Hello Anonymous
I have created a new WH called Graphql_test and created one tableMyTable andALTER TABLE MyTableADD CONSTRAINT PK_MyTable PRIMARY KEY NONCLUSTERED (ID) NOT ENFORCED;
It was empty table .
I added it to graphql api
and use muttation to add two records, it worked
Please see if this is helpful
Hi nilendraFabric,
Thanks for your quick respone.
I tried the above query but still unable to solve my issue. Below is the snapshot attched. Can you plz help me with this.
You might have to change the syntax like this
mutation {
createempinfo1: createempinfo(item: {Id: 30, Name: "Rohan", Address: "Amravati"}) {
result
}
createempinfo2: createempinfo(item: {Id: 31, Name: "Raj", Address: "Nagpur"}) {
result
}
}
- Anonymous1 year agoNot applicable
can you help me in this ?
- nilendraFabric1 year agoSuper User
There can be multiple reasons
Ensure pk is still valid
do try this
ALTER TABLE YourTable ADD CONSTRAINT PK_YourTable PRIMARY KEY NONCLUSTERED (Id) NOT ENFORCED;
And then try
mutation {
createempinfo1: createempinfo(item: {Id: 30, Name: "Rohan", Address: "Amravati"}) {
Id
Name
Address
}
createempinfo2: createempinfo(item: {Id: 31, Name: "Raj", Address: "Nagpur"}) {
Id
Name
Address
}
}- nilendraFabric1 year agoSuper User
Try to change the keys as well