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 a Data.toJson that uses reflection to lookup the adapter #3719

Merged
merged 2 commits into from
Dec 15, 2021

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Dec 15, 2021

A helper function to get a Json from a Data instance. This is a band-aid until we get better and multiplatform mockserver APIs

return adapter.obj()
}

fun Operation.Data.toJson(jsonWriter: JsonWriter, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mark it @ApolloExperimental?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering the same. I decided not to because it's 2.x functionality for which we don't have a multiplatform equivalent yet. So it's not really new and it's not really deprecated either.

Once we have a multiplatform mockserver API, we'll mark this one as deprecated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

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