Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
erwan-joly opened this issue May 21, 2020 · 2 comments · Fixed by #2086
Closed

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

erwan-joly opened this issue May 21, 2020 · 2 comments · Fixed by #2086
Assignees
Milestone

Comments

@erwan-joly
Copy link
Contributor

erwan-joly commented May 21, 2020

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
    ]
  }
}
@michaelstaib michaelstaib self-assigned this May 21, 2020
@michaelstaib michaelstaib added 🌶 hot chocolate 🔍 investigate Indicates that an issue or pull request needs more information. labels May 21, 2020
@michaelstaib
Copy link
Member

We can reproduce that and are working on a fix.

@michaelstaib michaelstaib added 🪲 bug and removed 🔍 investigate Indicates that an issue or pull request needs more information. labels May 23, 2020
@michaelstaib michaelstaib added this to the HC-10.5.0 milestone May 23, 2020
erwan-joly pushed a commit to erwan-joly/hotchocolate that referenced this issue Jun 27, 2020
@erwan-joly
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants