0 votes
in GraphQL by
What do you mean by aliases in GraphQL?

1 Answer

0 votes
by

In GraphQL, the alias is used to change the field name of the query. It facilitates you to rename the result of a field according to yourself.

For example:

{  

classA : employee(id : String){  

name  

}  

classB : employee(id: String){  

name  

}  

}  

In the above query, we have used an alias to use a different name for two 'employees.' Without alias, you will get an error in the result.

...