'Getting an error calling Hasura Insert, "type citext does not exist"

I have an existing Hasura instance that uses Postgres 12 and Hasura 2.2.0. It has a schema called hauth_catalog and in that schema there is a table called users. This table has an email field that uses the citext extension type. I checked using Pgadmin that this extension type exists in the same schema. And this table is already existing and has data in it.

Please note I am able to insert directly into Postgres using Pgadmin without error.

When I try to make an insert call using the Hasura schema based api or the graphql api I get the error in the title. Here's the related code using the schema style but again either one fails:

export const getQuery = record => ({
  type: "insert",
  args: {
    schema: "hauth_catalog",
    table: "users",
    objects: [record]
  }
});

const headers = {} as any;
  if (DATA_API_TOKEN && DATA_API_TOKEN !== "undefined") {
    headers["X-Hasura-Admin-Secret"] = DATA_API_TOKEN;
  }

  return axios({
    method: "post",
    url: DATA_API_URL, // path to Hasura
    headers,
    data: query
  });


Solution 1:[1]

citext is not supported by Hasura at the moment. Check out the list of supported data types

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lokesh kumar