correct-apricot
correct-apricotโ€ข2y ago

inferencer + hasura

Hi! I'm experimenting with the Hasura data provider, and I am most interested in refine's "Auto-generated CRUD UIs from your API data structure" feature. For now it seems that inferencing (eg. via AntdInferencer) is not yet supported (https://github.com/refinedev/refine/issues/3326) and when trying to create a resource using the cli using npm run refine create-resource it generates components, which use AntdInferencer:
import { IResourceComponentsProps } from "@pankod/refine-core";
import { AntdInferencer } from "@pankod/refine-inferencer/antd";

export const PostsCreate: React.FC<IResourceComponentsProps> = () => {
return <AntdInferencer />;
};
import { IResourceComponentsProps } from "@pankod/refine-core";
import { AntdInferencer } from "@pankod/refine-inferencer/antd";

export const PostsCreate: React.FC<IResourceComponentsProps> = () => {
return <AntdInferencer />;
};
So, check-mate. ๐Ÿ™‚ I maybe missing something here: what is the way to do scaffolding, to have the basic list/create/edit/show components with maybe all the fields of the resource? Also, I thought that the cli may help me select resources by name as well, as I assume it knows the Graphql schema, so it can figure out what types/resources are there.
GitHub
[FEAT] Inferencers with Hasura dataProvider ยท Issue #3326 ยท refined...
Is your feature request related to a problem? Please describe. When I initialize a new Hasura version of refine, and I use the command &quot;refine create-ressource&quot;, the pages are gen...
7 Replies
kapa.ai
kapa.aiโ€ข2y ago
Hi @Omer. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Omer
Omerโ€ข2y ago
Hey @beepxbeep , We have some news today that will make you happy ๐ŸŽ‰ Inferencer can now be used with GraphQL data providers. To try it out, update your refine dependencies (with npm run refine update) and check out our documentation at https://refine.dev/docs/packages/documentation/inferencer/#usage-with-graphql-backends-and-meta-values ! ๐ŸŽฏ Hasura example: https://github.com/refinedev/refine/tree/next/examples/inferencer-graphql-hasura
kapa.ai
kapa.aiโ€ข2y ago
Sorry @Omer, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist: Perhaps try again in 15mins?
deep-jade
deep-jadeโ€ข2y ago
Wow, thanks @Omer for getting back to me, I will try it soon and report how it went!
deep-jade
deep-jadeโ€ข2y ago
@Omer it seems to work nicely. I was also happy to see that you guys also support nhost. As nhost uses Hasura under the hood I created an issue to suggest to base the nhost data provider on the Hasura one, so that you don't need to implement the same Hasura API/behaviour twice: https://github.com/refinedev/refine/issues/4190
GitHub
[FEAT] @refinedev/nhost could be based on @refinedev/hasura ยท Issue...
Is your feature request related to a problem? Please describe. As nhost uses Hasura under the hood it may be better to base the implementation of the nhost data provider on the Hasura provider. Thi...
Omer
Omerโ€ข2y ago
Hey @beepxbeep ๐Ÿ‘‹ , we will be discontinuing native support for nHost data provider soon. If you would like to continue maintaining this package, please let us know. We can make the necessary changes in the documentation ๐Ÿ™‚
deep-jade
deep-jadeโ€ข2y ago
I think this is a good decision. ๐Ÿ™‚ One can simply use the Hasura data provider and the auth flow should be implemented separately anyway. You can close my issue then, thanks!

Did you find this page helpful?