I know if my data is coming like
{
id: 123
address: xyz
name: hello
}
and I want to alias name during Query I can do it like
query {
identification: id
address
full_name : name
}
So my data will look like this:
{
identification: 123
address: xyz
full_name: hello
}
but I want my upcoming data to look like this:
{
id : 123
info: {
address: xyz
name: hello
}
}
How can I achieve this within GraphQl Query only how can I give alias info
There is no GraphQL syntax that would allow you to do that client-side. Either apply the transformation programmatically inside your client code, or else change your schema on the server to reflect the data structure you need.