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

[generator] avoid duplicate argument deserialization #1379

Merged
merged 12 commits into from
Mar 8, 2022

Conversation

dariuszkuc
Copy link
Collaborator

@dariuszkuc dariuszkuc commented Feb 26, 2022

📝 Description

Update function data fetcher argument parsing logic to no longer depend on Jackson. Current logic is problematic as arguments passed to data fetchers are already coerced to appropriate type by graphql-java and Jackson is unaware of it leading to duplicate deserialization. This leads to custom scalar inputs deserialization problems.

Instead of relying on Jackson, argument mapping logic is updated to rely on reflection to instantiate objects based on their primary constructor.

NOTE: this change removes dependency on Jackson from graphql-kotlin-schema-generator. graphql-kotlin-server is still tied to Jackson for execution.

Breaking changes:

  • FunctionDataFetcher no longer accepts Jackson ObjectMapper as an argument
  • arrays are no longer supported by the schema generator

🔗 Related Issues

@dariuszkuc dariuszkuc added changes: major Changes require a major version module: generator Issue affects the schema generator and federation code labels Feb 26, 2022
@dariuszkuc dariuszkuc marked this pull request as ready for review February 27, 2022 18:30
@dariuszkuc dariuszkuc mentioned this pull request Feb 27, 2022
@dariuszkuc dariuszkuc merged commit 0dfb6c3 into ExpediaGroup:master Mar 8, 2022
@dariuszkuc dariuszkuc deleted the drop_jackson branch March 8, 2022 14:44
dariuszkuc pushed a commit to dariuszkuc/graphql-kotlin that referenced this pull request Apr 26, 2022
With the refactoring of our argument parsing logic (ExpediaGroup#1379) we dropped the support for the arrays. This had a side effect that directives could no longer be declared as accepting a list of arguments. Adding back support of arrays/varargs just for the directives.

Resolved: ExpediaGroup#1404
dariuszkuc pushed a commit to dariuszkuc/graphql-kotlin that referenced this pull request Apr 26, 2022
With the refactoring of our argument parsing logic (ExpediaGroup#1379) we dropped the support for the arrays. This had a side effect that directives could no longer be declared as accepting a list of arguments. Adding back support of arrays/varargs just for the directives.

Resolves: ExpediaGroup#1404
dariuszkuc pushed a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: major Changes require a major version module: generator Issue affects the schema generator and federation code
4 participants