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

Breaking change in AnyType deserialization on Input types #5730

Closed
1 task done
Andrej-Peplinski opened this issue Jan 30, 2023 · 3 comments · Fixed by #5740
Closed
1 task done

Breaking change in AnyType deserialization on Input types #5730

Andrej-Peplinski opened this issue Jan 30, 2023 · 3 comments · Fixed by #5740
Milestone

Comments

@Andrej-Peplinski
Copy link

Andrej-Peplinski commented Jan 30, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Product

Hot Chocolate

Describe the bug

We started to use hotchocolate in version 11 where it was possible to deserialize arbitrary input object (scalar and complex). When using complex input object, we used to get a deserialized dotnet representation being a IReadOnlyDictionary<string, object> (as it's also stated in the documentation).
However, this functionality has been broken in version 12 where the deserialized version if of type System.Object. As a consequence, all information send to the frontend is lost - which prevents us from from updating the HotChocolate packages. Furthermore, I have tried version 13.0.0.-rc.1 where the complete deserialization fails with an InvalidCastException.

Steps to reproduce

  1. Please clone the repro-project.
  2. The solution contains 2 (almost) identical projects using the same graphql schema - but using either HotChocolate version 11 or 12.
  3. In both projects set a breakpoint in the ParameterValuePair.Value.set property found in Program.cs.
  4. Start debugging either of the 2 project and copy the queries (from the Sample Queries.txt) into the Banana Cake Pop.
  5. Excute the simpleObjectAsDictionary mutation, and, once the breakpoint is hit, observe the value.
  • image
  • image

Relevant log output

No response

Additional Context?

Another way of "just" viewing the deserialisation defect is running the two project and inspecting the responses. In version 11 one show see this:
image

And in version 12 this:
image

Version

11.3.7, 12.6, 13.0.0-rc.1

@Andrej-Peplinski Andrej-Peplinski added the 🐛 bug Something isn't working label Jan 30, 2023
@michaelstaib michaelstaib added this to the HC-13.0.0 milestone Jan 30, 2023
@michaelstaib
Copy link
Member

michaelstaib commented Jan 31, 2023

The repro does not exist
https://github.com/Andrej-Peplinski/HotChocolateInputTypeAnyDeserialization

can you recreate it?

@michaelstaib
Copy link
Member

Wait ... i try to create a tests from the infos you provided.

@Andrej-Peplinski
Copy link
Author

I have now attached the solution here in case there are problems clone my repository from Github: HotChocolateInputTypeAnyDeserialization - Kopie.zip

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

Successfully merging a pull request may close this issue.

2 participants