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

Add serializeCompact to GraphQLQueryRequest #537

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlphilipp
Copy link

Goal

While upgrading from graphql-dgs-codegen-client-core to graphql-dgs-codegen-shared-core, we encountered some issue because the way GraphQLQueryRequest is serialized is slightly different. This PR allows GraphQLQueryRequest to be serialized as compact which is a little bit closer to what we had before. It's IMO a little better when we want to log the query, it stays on one line.

Implementation

To keep backward compatibility with Java, I created a new method. If backward compatibility with java is not an issue, I could just do one method with a default param, something like:

fun serialize(compact: Boolean = true): String {
    ...
}

Testing

I feel like the unit test I added is enough, but let me know if you disagree with that, I can add more tests.

@srinivasankavitha
Copy link
Contributor

Changes are looking good to me.

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.

2 participants