absent-sapphire
absent-sapphire2mo ago

Automatic meta for graphql/hasura data providers?

Is it possible to setup a data provider to discover/query to build https://github.com/refinedev/refine/blob/main/examples/inferencer-graphql-hasura/src/inferencerPredefinedMeta.ts instead of needing to create it by hand? This would let you go from 0 to full app for graphql based backends, making a very compelling quick start.
GitHub
refine/examples/inferencer-graphql-hasura/src/inferencerPredefinedM...
A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility. - refinedev/refine
2 Replies
kapa.ai
kapa.ai2mo ago
Hi @a_c_m. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, there isn't currently a built-in automatic way to generate the meta configuration for GraphQL/Hasura data providers in refine. The meta configuration needs to be created manually. However, refine does offer some tools and approaches to help with this: 1. GraphQL Code Generator: refine recommends using GraphQL Code Generator to automatically generate TypeScript types for your queries and mutations. This can simplify the process of writing queries and provide better developer experience with auto-completions. Documentation on GraphQL Code Generator 2. Inferencer: refine provides an Inferencer component that can generate sample code for views based on the meta configuration. While it doesn't automatically create the meta, it can use the meta you provide to infer fields and generate code. Documentation on Inferencer with GraphQL 3. Manual meta configuration: As shown in the example you linked, you need to manually define the meta configuration for each resource and method. This allows for fine-grained control over the fields and operations used in your GraphQL queries. While automatic meta generation would indeed be a compelling feature for quick starts with GraphQL backends, it's not currently available out-of-the-box in refine. The current approach requires manual configuration to ensure flexibility and control over the GraphQL operations. If you're interested in contributing to refine, this could potentially be an interesting feature to propose or develop. The refine team is open to contributions that enhance the developer experience. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@703579194784874506> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?