# Java client GraphQLResponse returns doubles instead of int

**URL:** <https://forum.weaviate.io/t/java-client-graphqlresponse-returns-doubles-instead-of-int/1172>\
**Category:** Support\
**Tags:** developer-experience\
**Created:** [January 4, 2024, 2:44pm UTC](https://forum.weaviate.io/t/java-client-graphqlresponse-returns-doubles-instead-of-int/1172 "2024-01-04T14:44:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jettro](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jettro/32/71_2.png) [@jettro](https://forum.weaviate.io/u/jettro)\
**Post date:** [January 4, 2024, 2:44pm UTC](https://forum.weaviate.io/t/java-client-graphqlresponse-returns-doubles-instead-of-int/1172/1 "2024-01-04T14:44:59Z")

</div>

I am working with the Java Client, to be honest, I don’t like it. Working with GraphQL is a mess. Especially parsing the response is bad. I have to manually inspect the response, work my way through Maps. Not nice, but it seems to work.

One thing I do not understand is that I get back Doubles, while the type is int. No idea what I am doing wrong, or can change.

Does anyone have tips?

---

<div class="post-metadata">

**Author:** ![antas-marcin](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/antas-marcin/32/20_2.png) [@antas-marcin](https://forum.weaviate.io/u/antas-marcin)\
**Post date:** [January 9, 2024, 3:23pm UTC](https://forum.weaviate.io/t/java-client-graphqlresponse-returns-doubles-instead-of-int/1172/2 "2024-01-09T15:23:18Z")

</div>

> Working with GraphQL is a mess

Yes, you’re right that Java client should have a better way of serializing the GraphQL response. I will try to experiment with a better generic GraphQL object which would ease the way how we now handle GraphQL responses.

> One thing I do not understand is that I get back Doubles, while the type is int. No idea what I am doing wrong, or can change.

Java client uses Gson for serialization / deserialization. I think that by default Gson deserializes numbers into Doubles and that’s why you are observing such a behaviour. I think that the only thing that you can try to do with this behaviour is to deserialize and then serialize the response to your typed Class that has a proper type definition on that given property, so that it will get eventually serialized to an int (not to Double)
