refine icon indicating copy to clipboard operation
refine copied to clipboard

[FEAT] Inferencers with Hasura dataProvider

Open purplefish32 opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

When I initialize a new Hasura version of refine, and I use the command "refine create-ressource", the pages are generated with Inferencers (Mantine, ANT etc..) but they dont seem to work with GraphQL, I keep getting the following GraphQL error :

{"errors":[{"extensions":{"code":"validation-failed","path":"$.selectionSet.refine_posts_by_pk.selectionSet"},"message":"missing selection set for 'refine_posts'"}]}

Describe alternatives you've considered

No response

Additional context

No response

Describe the thing to improve

It would be awsome if the Inferencers would work out of the box with GraphQL

purplefish32 avatar Dec 30 '22 15:12 purplefish32

Hey @purplefish32 thank you for the issue! 🙏 We have this in our backlog and start implementing this as soon as possible. We have multiple approaches we might follow. Not very clear right now but I think the result will provide a smooth way for inferencer to interact with GraphQL APIs. 🚀

aliemir avatar Jan 02 '23 23:01 aliemir

@aliemir do you plan to provide specific inferencing to Hasura or to any Graphql API in general?

beepsoft avatar Jan 25 '23 18:01 beepsoft

Hey @beepsoft sorry for the late response 🙏 Yes, we're definitely planning to include GraphQL support to our Inferencer package. It's probably be like, you providing the gql query to the inferencer for the resources and the inferencer generating views for it. We've looked for the opportunity to use introspection but ended up not liking the result and the way it works 😅

We're hoping to get started on this feature as soon as possible and release the GraphQL support. I'll try to prioritize this as much as I can 🚀

aliemir avatar Jan 27 '23 09:01 aliemir

@aliemir thank you so much for the explanation, eager to see and use the result. 😃

beepsoft avatar Jan 27 '23 11:01 beepsoft

I'm also keen to use a generic dataProvider for either GraphQL & Apollo Client. How's the progrss for this ticket so far? @aliemir

Mingyang-Li avatar Feb 12 '23 05:02 Mingyang-Li

Hi team, hitting this roadblock when trying to use Hasura data provider. Hasura makes it easy to wire up a Postgres DB and is an excellent combination with Refine.

mayurdhurpate avatar Mar 20 '23 14:03 mayurdhurpate

Hey @mayurdhurpate , Thank you for contacting us. The fact that Inferencer doesn't support GraphQL providers shouldn't be considered as a blocker. Inferencer is a Refine feature that shortens development time. You can already use Hasura with Refine. Please check out our Hasura examples and GraphQL documentation at https://refine.dev/docs/examples/data-provider/hasura/ and https://refine.dev/docs/advanced-tutorials/data-provider/graphql/.

omeraplak avatar Mar 20 '23 14:03 omeraplak

Hey @purplefish32 @mayurdhurpate @beepsoft @Mingyang-Li , 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/ ! 🎯

Hasura example: https://github.com/refinedev/refine/tree/next/examples/inferencer-graphql-hasura

omeraplak avatar Apr 12 '23 12:04 omeraplak