-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Data source connectors #89
Comments
Hi there, I've come across this issue about allowing quick adding of nodes backed by various data sources like REST, gRPC, etc., and I find it incredibly interesting and aligned with some of the challenges I'm facing. I'm particularly interested in the potential to create specific connectors for common services like CMS or e-commerce platforms. The idea would be to develop generic wrappers around the specific SDKs of these services, making them open-source for broader use and adaptation. A key feature I believe would be invaluable is the composability of these nodes. It would be great if we could import a node and then have the flexibility to redefine or add new properties according to our specific needs. This approach would significantly streamline the process of integrating multiple APIs by reducing the complexity involved in mapping and transforming data for the frontend. One practical use case I envision is in scenarios where there's a need to integrate a multitude of APIs. A composable node system would simplify this process, making it more manageable and efficient for frontend teams. The idea of open-source nodes that can be customized and extended fits perfectly with the needs of many developers looking to simplify API integrations. |
Hey @b-barry Thank you for the thoughtful reply! I agree with you on I find the idea of creating an ecosystem of datasources quite appealing, I however personally am not a big fan of exporting That being said, I still like the idea and would encourage a slightly different paradigm where the SDK-Ecosystem exports an How does that resonate with you? |
Hey @JoviDeCroock If I get it, we will have datasource that will be a wrapper around the SDK like you do in your example then you will have also exported interface for common field. Hovewer, I don't think the interface will be needed if we have a good typing from the datasource. What do you think? |
I agree, so basically the package exports type ShopifyProduct = { id: string; name: string; price: number }
export type ShopifyProductDatasource = Datasource<ShopifyProduct>; Now when that is used in a node({
name: 'Product',
datasource: new ShopifyDatasource(yourEnv),
// load becomes optional as it behind the scenes takes getOne or getMany
fields: t => ({
title: t.exposeString('name') // automatically suggests fields from the ShopifyProduct type
})
}) to put the API-surface in practice |
I like it, it is interesting ! Another suggestion below node({
name: 'Product',
datasource: new ShopifyDatasource(yourEnv),
fields: t => ({
title: t.exposeString('price.value') // could we have multi level mapping ?
})
}) |
Concluded in #103 (comment) |
Summary
Allow quick adding of nodes that are backed by REST, gRPC, and/or other data sources. (unsure about dbs)
Proposed Solution
TODO
The text was updated successfully, but these errors were encountered: