GraphQL Aliases

Zeus supports declaring aliases 🥸

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

Response:

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

Now you can access properties type-safe like this

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