Aliases

Zeus also supports declaring aliases 🥸

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

and here's the response:

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

Now you can access properties in a type-safe way by using:

aliasedQueryExecute.listCards.map((c) => c.atak);

Last updated