-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
Version Information
Server Version: v2.10.0.cli-migrations-v3
Environment
OSS
What is the current behaviour?
If i have a simple table, in sql server database, with columns id and name and I insert an empty array like so:
mutation {
insert_test_table(objects: []) {
affected_rows
}
}
I get the error back:
{
"errors": [
{
"extensions": {
"code": "unexpected",
"internal": {
"exception": {
"message": "[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'VALUES'.",
"type": "unsuccessful_return_code"
},
"query": "INSERT INTO [dbo].[test_table] OUTPUT INSERTED.[name], INSERTED.[id] INTO #inserted([name], [id]) VALUES "
},
"path": "$"
},
"message": "database query error"
}
]
}
What is the expected behaviour?
Should give the response:
{
"data": {
"insert_test_tables": {
"affected_rows": 0
}
}
}
which it does for PostgreSQL database.
How to reproduce the issue?
- Create any table
- do graphql insert with objects being empty array on that table
Can you identify the location in the source code where the problem exists?
I think it is occurring here. I am not too familiar with Haskell, so will have to look at more later.
adas98012