File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,35 @@ all =
406406 me1529416052: me(id: 456) {
407407 firstName
408408 }
409+ }"""
410+ , test " duplicate fields are merged and still only hashed as needed" <|
411+ \ () ->
412+ document
413+ [ leaf " avatar" []
414+ , leaf " avatar" []
415+ , Composite " me"
416+ [ Graphql . Internal . Builder . Argument . Argument " id" ( Graphql . Internal . Encode . int 123 )
417+ ]
418+ [ leaf " firstName" []
419+ , leaf " firstName" []
420+ , leaf " avatar" [ intArg { key = " size" , value = 1 } ]
421+ , leaf " avatar" [ intArg { key = " size" , value = 2 } ]
422+ ]
423+ , Composite " me"
424+ [ Graphql . Internal . Builder . Argument . Argument " id" ( Graphql . Internal . Encode . int 123 )
425+ ]
426+ [ leaf " firstName" []
427+ , leaf " firstName" []
428+ ]
429+ ]
430+ |> Graphql . Document . serializeQuery
431+ |> Expect . equal """ query {
432+ avatar
433+ me(id: 123) {
434+ firstName
435+ avatar2648687506: avatar(size: 1)
436+ avatar76140203: avatar(size: 2)
437+ }
409438}"""
410439 ]
411440 ]
You can’t perform that action at this time.
0 commit comments