From e9b03a06e08d89b08149ce5880ee1de3167bdad2 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 25 Oct 2024 17:15:59 +0400 Subject: [PATCH] Improve Batch Set error lil bit (#297) --- .../static/codegen/src/GqlDbCustomTypes.res | 12 +++++++----- .../static/codegen/src/db/DbFunctionsEntities.res | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res b/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res index ebacf5e91..f23f36023 100644 --- a/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res +++ b/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res @@ -26,9 +26,11 @@ module Int = { external fromStringUnsafe: string => int = "Number" - let schema = - S.union([ - S.int, - S.string->S.transform(_s => {parser: string => string->fromStringUnsafe}), - ])->S.setName("GqlDbCustomTypes.Int") + let schema = S.union([ + S.int, + S.string->S.transform(_s => { + parser: string => string->fromStringUnsafe, + serializer: Utils.magic, + }), + ])->S.setName("GqlDbCustomTypes.Int") } diff --git a/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res b/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res index f40e6b91e..4f0cffcfa 100644 --- a/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res +++ b/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res @@ -53,7 +53,7 @@ let makeBatchSet = (~table: Table.table, ~rowsSchema: S.schema | exception exn => exn->ErrorHandling.mkLogAndRaise( ~logger?, - ~msg=`Failed during batch read of entity ${table.tableName}`, + ~msg=`Failed during batch set of entity ${table.tableName}`, ) | res => res }