0

I am getting a response from external service as.
Actual Response:-

{
  itemId:1,
  aisleId:123,
  deptId:1234,
  price:{
    basePrice: 1
    specialPrice: 2
   ...extra fields
  }
  ...extra fields
}

In my service i want to convert the above response to some like this

{
  itemId: 1,
  price:{
   basePrice: 1
   specialPrice: 1
  }
}

Can we do this conversion using graphql. I am not executing any query, i get the actual response from some other service, i am converting the actual response into POJO using ObjectMapper.
Now i want to convert the original POJO into simple POJO with only few fields based on some schema.


I am aware that we can have another class simple POJO and map the original POJO to simple one and return. But i am looking for some other options.

Mohammad Asif
  • 97
  • 2
  • 6

0 Answers0