I wonder if exporting GraphQL data to a SQL database in a real-time (or automated) fashion is something that is being discussed, or possible.
GraphQL has serious limitations in the spec itself (aggregation, sort, etc.) which _(if I'm correct, and as a beginner in GraphQL, do correct me if I'm wrong)_ make each implementation of those features potentially different.
I'm mostly asking this because the awesome Metabase (BI and Analytics) doesn't have GraphQL support, it mainly support SQL-based DB, but supporting GraphQL would be very much useful, as it would allow to use a single graphQL endpoint to fetch data from multiple sources, since GraphQL can be used as a sources aggregator.
We've had some discussion already about it at https://github.com/metabase/metabase/issues/6297 and the current state of discussion leads to using a third party tool, that would basically create/keep up-to-date a postgre database, based from data fetched from a GraphQL endpoint.
So, I wonder if such tool exists, if it's something that's somehow planned, in progress, or impossible. I believe that'd be a great addition to the open source world.
Hi @Vadorequest
Closing this issue since the question is not about GraphQL.jsand such questions is beyond the scope of this repo:
We want to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track bugs and features that affect development.
If you have a question on how to use GraphQL, please post it to Stack Overflow with the tag #graphql.
Please do not post general questions directly as GitHub issues. They may sit for weeks unanswered, or may be spontaneously closed without answer.
P.S. Here is short answers to your questions:
GraphQL has serious limitations in the spec itself (aggregation, sort, etc.) which (if I'm correct, and as a beginner in GraphQL, do correct me if I'm wrong) make each implementation of those features potentially different.
@Vadorequest GraphQL is query language for your API not for your DB. So GraphQL wasn't designed to work with RAW data. If some aggregation, sort, etc. are needed by your client you should expose it using additional fields (for aggregation) or additional arguments (for sort).
So, I wonder if such tool exists, if it's something that's somehow planned, in progress, or impossible. I believe that'd be a great addition to the open source world.
You can't automatically dump all the data from arbitrary GraphQL API since you GraphQL types can contain loops and same data in different representations (aggregated, duplicated, etc.) also some fields can contain required arguments.
That said you can make a tool that will get data based on one or multiple hand-written GraphQL queries and automatically normalize it into the DB tables based on a combination of id field (if present) and __typename.
Thanks @IvanGoncharov for explaining and not just closing the question. I wasn't sure where to ask since there are so many repositories about graphQL.
Most helpful comment
Hi @Vadorequest
Closing this issue since the question is not about
GraphQL.jsand such questions is beyond the scope of this repo:P.S. Here is short answers to your questions:
@Vadorequest GraphQL is query language for your API not for your DB. So GraphQL wasn't designed to work with RAW data. If some aggregation, sort, etc. are needed by your client you should expose it using additional fields (for aggregation) or additional arguments (for sort).
You can't automatically dump all the data from arbitrary GraphQL API since you GraphQL types can contain loops and same data in different representations (aggregated, duplicated, etc.) also some fields can contain required arguments.
That said you can make a tool that will get data based on one or multiple hand-written GraphQL queries and automatically normalize it into the DB tables based on a combination of
idfield (if present) and__typename.