Hotchocolate: Stitched variable of type [Long!] and [Int!] are concatenated.

Created on 21 May 2020  路  2Comments  路  Source: ChilliCream/hotchocolate

Describe the bug
Hi, i recently got an issue with a stitched schema. My [Long!] content is getting concatenated to a array of one item (concatenation of all items). I've been able to notice that on version 10.3.6 and 10.4.3 (latest release).
I've been able to test some things :

  • [Long!] and [Int!] are not working [1,2,3,4,5,6] => [123456]
  • Input types are also not working { "values": [1, 2, 3 ] } => { "values": [123 ] }
  • [String!] is working fine ["1","2","3","4","5","6"] => ["1","2","3","4","5","6"]
  • [Boolean!] is also working fine [true, false, true] => [true, false, true]

Stitched variable of type [Long!] and [Int!] are concatenated.

To Reproduce
Steps to reproduce the behavior:

query GetMyData($Ids: [Long!]) {
    myfield {
        mystitchedfield(ids: $Ids) {
          count
        }
    }
}

arguments
{
 "Ids": [1,2,3,4,5,6]
}

this requests when stitched will send [123456] to the server instead of [1,2,3,4,5,6]

Expected behavior
An array of 5 Scalar elements should not be concatenated into an array of 1 element

Desktop (please complete the following information):

  • OS: Windows
  • Version 10.4.3

Additional context
https://github.com/erwan-joly/HotChocolateStitchingBug
this bug is shown in this small repo. To use it

query ($ids: [Int!]) {
    getids(ids: $ids)
}

with arguments

{
    "ids": [
        1,
        2,
        3
    ]
}

when post to http://localhost:5050 the result is

{
  "data": {
    "getids": [
      123
    ]
  }
}

when post to http://localhost:5051 the result is

{
  "data": {
    "getids": [
      1,
      2,
      3
    ]
  }
}
bug 馃尪 hot chocolate

Most helpful comment

We can reproduce that and are working on a fix.

All 2 comments

We can reproduce that and are working on a fix.

I can confirm 10.5.0-preview.7 solve the issue as expected

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sergeyshaykhullin picture sergeyshaykhullin  路  3Comments

benmccallum picture benmccallum  路  3Comments

hognevevle picture hognevevle  路  3Comments

louisjrdev picture louisjrdev  路  3Comments

sgt picture sgt  路  4Comments