mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-11-11 16:27:14 +03:00
parent
887b7ca835
commit
8ecb80d2da
@ -65,7 +65,8 @@ convertRowObj
|
||||
-> m [(PGCol, S.SQLExp)]
|
||||
convertRowObj val =
|
||||
flip withObject val $ \_ obj -> forM (Map.toList obj) $ \(k, v) -> do
|
||||
prepExp <- asPGColVal v >>= prepare
|
||||
prepExpM <- asPGColValM v >>= mapM prepare
|
||||
let prepExp = fromMaybe (S.SEUnsafe "NULL") prepExpM
|
||||
return (PGCol $ G.unName k, prepExp)
|
||||
|
||||
mkConflictClause
|
||||
|
@ -51,6 +51,7 @@ gqlSpecFiles =
|
||||
, "insert_mutation/article_on_conflict_error_03.yaml"
|
||||
, "insert_mutation/person.yaml"
|
||||
, "insert_mutation/person_array.yaml"
|
||||
, "insert_mutation/order.yaml"
|
||||
, "nested_select_query_article.yaml"
|
||||
, "select_query_article_limit_offset.yaml"
|
||||
, "select_query_article_limit_offset_error_01.yaml"
|
||||
|
@ -50,3 +50,11 @@ query:
|
||||
city TEXT NOT NULL,
|
||||
resident_id INTEGER REFERENCES resident(id)
|
||||
)
|
||||
- type: run_sql
|
||||
args:
|
||||
sql: |
|
||||
CREATE TABLE orders (
|
||||
id SERIAL PRIMARY KEY,
|
||||
placed TIMESTAMPTZ NOT NULL,
|
||||
shipped TIMESTAMPTZ
|
||||
)
|
||||
|
20
server/test/testcases/insert_mutation/order.yaml
Normal file
20
server/test/testcases/insert_mutation/order.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
description: Insert into order table with a null value
|
||||
url: /v1alpha1/graphql
|
||||
status: 200
|
||||
query:
|
||||
query: |
|
||||
mutation insert_orders{
|
||||
insert_orders(
|
||||
objects: [
|
||||
{
|
||||
placed: "2017-08-19 14:22:11.802755+02",
|
||||
shipped: null
|
||||
}
|
||||
]
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
affected_rows
|
||||
}
|
||||
}
|
@ -24,4 +24,8 @@ query:
|
||||
args:
|
||||
schema: public
|
||||
name: address
|
||||
- type: track_table
|
||||
args:
|
||||
schema: public
|
||||
name: orders
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user