Skip to content

BREAKING CHANGE: [spring-server] default data fetcher should use Jackson object mapper from spring context #525

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

Merged
merged 5 commits into from
Dec 27, 2019

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

Currently it is not possible to provide custom Jackson object mapper (e.g. one that includes java date time module) to be used by default function data fetcher. In order to use custom object mapper users have to create their own instance of data fetcher factory provider. This change updates the data fetcher factory provider to accept an instance of object mapper that will be used by the function data fetcher.

🔗 Related Issues

Resolves: #524

… from spring context

Currently it is not possible to provide custom Jackson object mapper (e.g. one that includes java date time module) to be used by default function data fetcher. In order to use custom object mapper users have to create their own instance of data fetcher factory provider. This change updates the data fetcher factory provider to accept an instance of object mapper that will be used by the function data fetcher.

Resolves: ExpediaGroup#524
@smyrick
Copy link
Contributor

smyrick commented Dec 20, 2019

LGTM

@smyrick smyrick added changes: minor Changes require a minor version type: enhancement New feature or request labels Dec 20, 2019
@smyrick
Copy link
Contributor

smyrick commented Dec 20, 2019

Is this ready for review? Was there some other feature you were looking to add?

@dariuszkuc
Copy link
Collaborator Author

Is this ready for review? Was there some other feature you were looking to add?

Looking into adding some unit test for this.

@dariuszkuc dariuszkuc marked this pull request as ready for review December 20, 2019 22:57
Previous default implmenetation is now renamed to SimpleKotlinDataFetcherFactoryProvider.
@smyrick
Copy link
Contributor

smyrick commented Dec 22, 2019

@dariuszkuc This look good to me. We have the single test. Is this good to merge?

@dariuszkuc dariuszkuc added the status: do not merge Do not merge until this is removed label Dec 25, 2019
@dariuszkuc dariuszkuc removed the status: do not merge Do not merge until this is removed label Dec 26, 2019
@dariuszkuc
Copy link
Collaborator Author

@smyrick this should be good to merge - was looking into whether we need to have that jackson object mapper in the first place and unfortunately it is required in order to process any complex input objects.

On the side note - currently we do an extra conversion from primitive scalar value to the same scalar type (as noted here). Unsure how big of a perf impact that is but we might want to optimize it as well.

@smyrick smyrick added changes: major Changes require a major version and removed changes: minor Changes require a minor version labels Dec 27, 2019
@smyrick
Copy link
Contributor

smyrick commented Dec 27, 2019

Major version changes now that we changed from class to interface

@smyrick smyrick merged commit f9970e4 into ExpediaGroup:master Dec 27, 2019
@dariuszkuc dariuszkuc deleted the jackson branch December 31, 2019 15:03
@smyrick smyrick changed the title [spring-server] default data fetcher should use Jackson object mapper from spring context BREAKING CHANGE: [spring-server] default data fetcher should use Jackson object mapper from spring context Jan 2, 2020
@smyrick smyrick added this to the 2.0.0 milestone Feb 1, 2020
dariuszkuc added a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
… from spring context (ExpediaGroup#525)

* [spring-server] default data fetcher should use Jackson object mapper from spring context

Currently it is not possible to provide custom Jackson object mapper (e.g. one that includes java date time module) to be used by default function data fetcher. In order to use custom object mapper users have to create their own instance of data fetcher factory provider. This change updates the data fetcher factory provider to accept an instance of object mapper that will be used by the function data fetcher.

Resolves: ExpediaGroup#524

* unit test for verifying proper object mapper is used

* convert KotlinDataFetcherFactoryProvider to interface

Previous default implmenetation is now renamed to SimpleKotlinDataFetcherFactoryProvider.

* add integration test to verify custom jackson bindings work with function data fetcher

* remove unnecessary val definition
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 type: enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

[spring-server] default data fetcher should use Jackson object mapper from spring context
2 participants