这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/src-lib/Hasura/GraphQL/Resolve/Mutation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions server/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions server/test/testcases/create_tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 20 additions & 0 deletions server/test/testcases/insert_mutation/order.yaml
Original file line number Diff line number Diff line change
@@ -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
}
}
4 changes: 4 additions & 0 deletions server/test/testcases/track_tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ query:
args:
schema: public
name: address
- type: track_table
args:
schema: public
name: orders