r/graphql • u/nickfromfargo • Aug 15 '24
Fastest way to turn a SQL database into a GraphQL API?
I'm looking for recommendations and opinions for third party solutions. hoping for simplicity...
Signup>Connect a DB>Define some Rules/Policies>Use the API
Any links to any demo would be super helpful. not a lot out there.
TIA.
Update-- I'll try to keep a running list of suggestions/options here.
Ideally not limited to any SQL flavor.. definitely run into to multiple SQL flavors and would love to just have one go-to solution.
Automated resolvers would be a game changer. Diving in a bit more – I think an admin/config experience.. to Connect multiple DBs, select the tables, define the rules/policies for each, then start using the APIs.
So far - this is the list. What is missing?
UPDATE: So far Devii takes the cake. easy, simple, and exactly what was needed!
https://www.graphile.org/postgraphile/
https://supabase.com/blog/pg-graphql
https://github.com/Airsequel/AirGQL
https://prisma.typegraphql.com/
https://www.linkedin.com/posts/apigen_apigen-platform-demo-activity-7211397780672536576-qVOU/
5
u/hleszek Aug 15 '24
https://www.graphile.org/postgraphile/
4
u/Dyogenez Aug 15 '24
I've been using the open source version of Hasura, hosted on Heroku. It allows you to connect to a database and decide which tables, and even which columns are available to which users. Permissions are pretty flexible, so you can control it based on values in other tables (ex: Make a blog post friends only, and then only people you're friends with would be able to access that row from the table).
2
u/Nick-Van-Landschoot Aug 16 '24
I’ve been working on a tool that simplifies the creation of REST APIs with custom logic, and we're expanding to include support for GraphQL. One interesting challenge has been generating custom functionality through resolvers while keeping things straightforward for users who just need basic connectors.
We recently put together a demo where we created a full facial verification system in just over two minutes using our platform. Though this demo focuses on a REST API, the process for a GraphQL API would be similar, with more focus on the algorithmic side.
I’d love to hear from anyone who has experience with GraphQL or with any other protocol for that matter and if you have a burning desire to fix/remove something in your workflow.
Here's a demo if you're curious: https://www.linkedin.com/posts/apigen_apigen-platform-demo-activity-7211397780672536576-qVOU/
2
u/Querydeck Aug 16 '24
Still in beta but you can check it out https://querydeck.io
2
u/rufio7777777 Aug 16 '24
Nhost.io
2
u/nice-thread Aug 23 '24
Hi!
My name is Anthony and I am the Founder/CEO of Devii,
This is one of the exact reasons and use cases we built our Instant API Engine! We want the easiest way to spin up and manage safe, scalable GraphQL APIs for any SQL database.
(Extra: we initially built the middleware for ourselves several years ago and then decided to productize it for both our startup and enterprise clients thereafter.)
To create an API with portal.devii.io (after you create an account of course)
If you decide to give Devii a try, then I would love to hear your feedback! https://portal.devii.io/auth/register
I hope this helps!
Best,
-A-
2
u/mubaidr Aug 15 '24
I am surprised nobody mentioned pg_graphql used by supabase too: https://supabase.com/blog/pg-graphql
1
u/nickfromfargo Aug 15 '24 edited Aug 15 '24
So far - this is the list. What is missing?
https://www.graphile.org/postgraphile/
https://hasura.io
https://supabase.com/blog/pg-graphql
https://github.com/Airsequel/AirGQL
https://grafbase.com/
https://prisma.typegraphql.com/
https://exograph.dev
1
u/last-cupcake-is-mine Aug 15 '24
Grafbase if you want a PaaS solution
1
u/chaoticbastian Aug 15 '24
I guess it would help are you using MySQL or postgresql because different libraries support one or the other
1
u/bonkykongcountry Aug 15 '24
Surprised to one mentioned that you can download a graphql parser in your language of choice and implement the resolvers yourself.
1
u/adwolesi Aug 15 '24
https://github.com/Airsequel/AirGQL generates a full-fledged GraphQL API for SQLite databases.
1
u/SuitablyTyped Aug 15 '24
Take a look at Exograph (https://exograph.dev) if you are using Postgres. It's super easy to get started and deploy to any cloud. You can play with it without downloading it at https://exograph.dev/playground
1
u/gatewaynode Aug 16 '24
https://hasura.io/
1
u/bin_chickens Aug 16 '24
Prisma + pothos + the prisma pothos crud generator
1
u/fasibio Aug 16 '24
If golang as programming language is not an issue. I have written https://github.com/fasibio/autogql. It's completely hackable bei Middleware pattern. I have written to have a real business object dependency. And not technical stuff I the middle with node and edges. But to be fair https://entgo.io/docs/graphql/ entgql is the most near other solution but with node and edges
1
u/garyfung Aug 19 '24
Nhost + Hasura. Generous free tier and backend batteries included
You’re welcome
1
u/fernandohur Aug 19 '24
While not GraphQL, I'd be curious if you could look at https://synthql.dev/, a project of mine.
It basically gives you a type safe HTTP client over your PostgreSQL. I'd say this combination is specially interesting if you don't want to force GraphQL into the client(s) of the API.
If they are already using React, and something like react-query then it's specially useful as SynthQL already offers a useSynthQL hook that essentially wraps TanStack query to give you type safety and perf advantages.
I should warn that this is still under active development, so definitely not ready for production.
A more mature tool solving a similar problem is https://docs.postgrest.org/en/v12/
1
u/makabuka Apr 24 '25
it's just exactly that I found here - https://www.nuget.org/packages/NReco.GraphQL
Describe or generate entities based on the database schema in a JSON file. Add the connection string and feel free to make direct calls to the database.