-
I am having difficulties correctly fetching data from my database using Hasura as the data provider. I am trying to utilize the useList hook to retrieve data, using the following code snippet:
While using sorters, I get the following error in the console:
If I make 'asc' uppercase, I get the following warning in my IDE:
It seems crudSort is hard-coded to only accept lowercase sorters, which Hasura does not accept (using the graphql-default naming convention, released 2022). If I remove the sorters, and only use the filtering, I get the following error in the console:
Hasura default uses taskStages_bool_exp, but with the graphql-default naming convention, it expects types as PascalCase, such as:
Is there any quick-fix to making the naming-convention I have started with, correctly working? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Update: Adding:
to the useList hook, seems to get rid of the error This, on the other hand, causes several other errors, such as: Also:
I do believe I have correctly defined Hasura as a graphql data provider, as I have managed to correctly fetch data using the |
Beta Was this translation helpful? Give feedback.
Solution: export const dataProvider = DataProvider(client, { namingConvention: "graphql-default" });