Basics
GraphQL
DocsAliasesGraphQL

Aliases

Zeus supports declaring aliases by using:

const aliasedQueryExecute = await chain('query')({
  listCards: {
    __alias: {
      atak: {
        attack: [
          { cardID: ['1'] },
          {
            name: true,
            description: true,
          },
        ],
      },
    },
  },
});

and this is the response:

{
  "listCards": [
    {
      "atak": [
        {
          "name": "Zelma",
          "description": "Central"
        }
      ]
    }
  ]
}

Now you can access properties in a type-safe way like this:

aliasedQueryExecute.listCards.map((c) => c.atak);
On this pageAliases