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

feat: allow to set default InputValueSerializer #675

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

dwilkolek
Copy link
Contributor

@dwilkolek dwilkolek commented Apr 18, 2024

Extended GraphQLProjection to allow setting custom InputValueSerializer per thread.
This change will allow to use any scalars with DgsClient client and setup them once.

@Test
fun test() {
    InputValueSerializerProvider.serializer = InputValueSerializer(
        mapOf(UUID::class.java to UUIDScalar.INSTANCE.coercing)
    )
    /* line below would fail before */
    val query = DgsClient.buildQuery {
        movies(filter = UUID.randomUUID())
    }
}

closes #455

@srinivasankavitha
Copy link
Contributor

cc @mbossenbroek

@mbossenbroek
Copy link
Contributor

Thanks @dwilkolek for adding this! 👏

@dwilkolek
Copy link
Contributor Author

No problem, I find this project fascinating. I'll keep an eye for good first issues 😉

@mbossenbroek mbossenbroek merged commit 8003b1b into Netflix:master Apr 20, 2024
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 this pull request may close these issues.

Impossible to define scalars for input parameters in Kotlin2 generated code
3 participants