Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 677 Bytes

renaming.md

File metadata and controls

36 lines (28 loc) · 677 Bytes

Renaming attributes in response

The rename argument can be used to rename attributes in the response.

It is a comma-separated list of name:different_name. Nested attributes can be specified using a dot notation.

GET /rest/users/1?rename=name:different_name

will respond with:

{
  "data": {
    "different_name": "Anthony"
  }
}

instead of:

{
  "data": {
    "name": "Anthony"
  }
}

GraphQL does not need the rename argument since it natively uses selection fields.