@@ -465,7 +465,24 @@ let ``Execution when querying the same field twice will return it`` () : Task =
465465[<Fact>]
466466let ``Execution documentId handles escaped string values correctly`` () : Task =
467467 let schema =
468- Schema ( Define.Object< TwiceTest> ( " Type" , [ Define.Field ( " a" , StringType, fun _ x -> x.A); Define.Field ( " b" , IntType, fun _ x -> x.B) ]))
468+ Schema (
469+ Define.Object< TwiceTest> (
470+ " Type" ,
471+ [
472+ Define.Field (
473+ " a" ,
474+ StringType,
475+ " " ,
476+ [ Define.Input ( " arg" , StringType) ],
477+ fun ctx x ->
478+ match ctx.TryArg ( " arg" ) with
479+ | ValueSome arg -> arg
480+ | ValueNone -> x.A
481+ )
482+ Define.Field ( " b" , IntType, fun _ x -> x.B)
483+ ]
484+ )
485+ )
469486 // Query with string containing special characters that need escaping
470487 let query = """ query Example { a(arg: "test\"quote\nline\ttab\\backslash") }"""
471488 task {
@@ -482,7 +499,7 @@ let ``Execution documentId is different for different queries`` () : Task =
482499 let query1 = " query Example1 { a }"
483500 let query2 = " query Example2 { b }"
484501 task {
485- let executor = Executor( schema)
502+ let executor = Executor ( schema)
486503 let! result1 = executor.AsyncExecute ( query1, getMockInputContext, { A = " aa" ; B = 2 })
487504 let! result2 = executor.AsyncExecute ( query2, getMockInputContext, { A = " aa" ; B = 2 })
488505 result1.DocumentId |> notEquals result2.DocumentId
@@ -497,7 +514,7 @@ let ``Execution documentId is same for semantically identical queries`` () : Tas
497514 let query2 = " query Example{a b}"
498515 let query3 = " query Example { a, b }"
499516 task {
500- let executor = Executor( schema)
517+ let executor = Executor ( schema)
501518 let! result1 = executor.AsyncExecute ( query1, getMockInputContext, { A = " aa" ; B = 2 })
502519 let! result2 = executor.AsyncExecute ( query2, getMockInputContext, { A = " aa" ; B = 2 })
503520 let! result3 = executor.AsyncExecute ( query3, getMockInputContext, { A = " aa" ; B = 2 })
0 commit comments