GraphQl fragment to Pojo

Viewed 80

Recently I had to switch a GraphQl endpoint for a REST API which is just a layer on top of the GraphQl endpoint that I was querying since the beginning of the project.

Querying GraphQl was easy, simple and thru some libs provided by Netflix

I was able to deserialize the responses into POJOs (just need to provide the schema), all of this in order to apply some business logic.

Now that I had to switch to the REST API, I'm having a hard time trying to deserialize the responses and I don't really like the idea of creating hardcode POJOs for each different response (using the fragments).

So far I couldn't find any lib to create either a JSON or a POJO given a GraphQl fragment. Do you know if is actually possibile to achieve something like that?

I know It doesn't make any sense that I had to switch to the REST API but it doesn't depend by me

Thank you in advance !!

0 Answers
Related