Initial page creation.

changeling 2019-05-14 17:40:29 -05:00
parent d339007c92
commit 9de6e9ee28

@ -0,0 +1,37 @@
GraphQL allows you to `alias`, or rename, elements of your queries. This is built-in and trivial, but a powerful feature that is often overlooked.
To alias, simply prefix the elements you wish to rename with the desired string followed by `:`, like so:
```
{
imaginarium:places(
id:"UGxhY2VUeXBlOjUxOA==, UGxhY2VUeXBlOjU0Nw==")
{
menagerie:edges {
dogs:node {
dogtag:id
place:name
favoritePizzaPlace:name
}
}
}
}
```
Which results in:
```
{
"data": {
"imaginarium": {
"menagerie": [
{
"dogs": {
"dogtag": "UGxhY2VUeXBlOjUxOA==",
"place": "Dallas, Dallas, Texas, United States",
"favoritePizzaPlace": "Dallas, Dallas, Texas, United States"
}
}
]
}
}
}
```