API

Do I have to write my own API to manage my own data internally?
2 Replies
kapa.ai
kapa.ai4w ago
Hi @asya. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- No, you don't have to write your own API to manage your data internally when using Refine. Refine provides many out-of-the-box data providers that can be used to communicate with various APIs. These data providers include: - Simple REST API (https://github.com/refinedev/refine/tree/master/packages/simple-rest) - GraphQL (https://github.com/refinedev/refine/tree/master/packages/graphql) - NestJS CRUD (https://github.com/refinedev/refine/tree/master/packages/nestjsx-crud) - Airtable (https://github.com/refinedev/refine/tree/master/packages/airtable) - Strapi (https://github.com/refinedev/refine/tree/master/packages/strapi) - Strapi v4 (https://github.com/refinedev/refine/tree/master/packages/strapi-v4) - Supabase (https://github.com/refinedev/refine/tree/master/packages/supabase) - Hasura (https://github.com/refinedev/refine/tree/master/packages/hasura) - Medusa (https://github.com/refinedev/refine/tree/master/packages/medusa) - Appwrite (https://github.com/refinedev/refine/tree/master/packages/appwrite) These data providers allow you to easily integrate with existing APIs without the need to write your own. Additionally, Refine supports the creation of custom data providers if you have specific requirements that are not covered by the built-in options. Here is an example of what a data provider looks like in Refine:
const dataProvider = {
create: ({ resource, variables, meta }) => Promise,
createMany: ({ resource, variables, meta }) => Promise,
deleteOne: ({ resource, id, meta }) => Promise,
deleteMany: ({ resource, ids, meta }) => Promise,
getList: ({ resource, pagination, sorters, filters, meta }) => Promise,
getMany: ({ resource, ids, meta }) => Promise,
getOne: ({ resource, id, meta }) => Promise,
update: ({ resource, id, variables, meta }) => Promise,
updateMany: ({ resource, ids, variables, meta }) => Promise,
};
const dataProvider = {
create: ({ resource, variables, meta }) => Promise,
createMany: ({ resource, variables, meta }) => Promise,
deleteOne: ({ resource, id, meta }) => Promise,
deleteMany: ({ resource, ids, meta }) => Promise,
getList: ({ resource, pagination, sorters, filters, meta }) => Promise,
getMany: ({ resource, ids, meta }) => Promise,
getOne: ({ resource, id, meta }) => Promise,
update: ({ resource, id, variables, meta }) => Promise,
updateMany: ({ resource, ids, variables, meta }) => Promise,
};
For more details, you can refer to the Refine documentation on data fetching (https://refine.dev/docs/guides-concepts/data-fetching/). By leveraging these built-in data providers, you can save time and effort in managing your data internally. Sources: - Build internal tools using Low-Code with Refine (https://refine.dev/blog/build-internal-tools-using-low-code-with-refine/#out-of-the-box-data-providers) - Developing Internal Tools in 2024 (https://refine.dev/blog/internal-tools/#backend-api-and-data) - Data Fetching (https://refine.dev/docs/guides-concepts/data-fetching/) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4w ago
<@1280799667868798996> kapa.ai is still learning and improving, please let us know how it did by reacting below