I have Graphql query in this format :
query {
priceData {
customer
id
title
dob
}
}
In java, we use this query in String format Like :
"{\"query\":\"query {\\r\\n priceData {\\r\\n customer \\r\\n id\\r\\n title\\r\\n dob\\r\\n }\\r\\n}\",\"variables\":{}}"
Here we hardcoded this query. Is there any other where we generate this query dynamically? Something like I create a POJO java class or Map type and later parse it to convert in GraphQL query string.