Closed henraso closed 3 days ago
I did not dive too much into the code before writing, but it seems to be a setting for naming convention when defining dataProvider, as follows:
export const dataProvider = DataProvider(client, { namingConvention: "graphql-default" });
I looked through all the documentation, and did not find anything about it there. Should be added to Hasura Data Provider page.
Describe the bug
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:
Error: expected one of the values ['ASC', 'ASC_NULLS_FIRST', 'ASC_NULLS_LAST', 'DESC', 'DESC_NULLS_FIRST', 'DESC_NULLS_LAST'] for type 'OrderBy', but found 'asc':
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:
TaskStagesBoolExp
, which is defined in my query:Is there any quick-fix to making the naming-convention I have started with, correctly working? Thanks in advance.
Steps To Reproduce
npm run refine dev
Expected behavior
Correctly fetching data from Hasura data provider.
Packages
Additional Context
No response
Edit: updated versions of packages