Aliases
With aliases you can rename the output fields of a query. They are defined by a colon : after the field name (or after the arguments if they are present)
and can be double quoted if they contain special characters or spaces.
To clarify, let’s see an example:
{ "id": "AI-Models", "models": [ { "name": "GPT-4o", "score": 71.49 }, { "name": "Claude", "score": 93.2 }, { "name": "LLAMA", "score": 88.7 } ]}If we want to obtain the top scoring model names but renaming the field to topScores, we can use the following query:
{ models(score>80.0).name: topScores}{ "topScores": [ "Claude", "LLAMA" ]}Or if we want to name the output field using spaces, we can double-quote it:
{ models.name: "model names"}{ "model names": [ "GPT-4O", "Claude", "LLAMA" ]}