Live data from Hacker News

Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

github.com

11–20 of 26 posts

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#11
post #9

With WAMP and crossbar.io, you can already directly query in SQL you PostGres db from the browser. So this does not give you real advanstages over existing solutions. The real benefit of GraphQL is that it unifies stuff: - several queries can be masqued as one; - several storages systems can be queried in one shot; - the cache layer can be integrated in the graphql server; - queries can actually no type in any backen…

AGPL license is probably a non-starter for many/most potential use cases of crossbar.io.

GPLv2 was fine. But GPLv3 can make one look for alternatives. AGPL will cause many to simply lose all interest. I suspect GPLv3 is why we see so much MIT/BSD/Apache licensed software these days.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#12

People might also be interested in Postgrest. Postgrest is an open-source project that creates a REST api based on a Postgres schema: https://github.com/begriffs/postgrest It ain't GraphQL, and I don't understand GraphQL enough to note functional differences. Postgrest made it extremely easy to serve a more-than-sufficient api for my db though.

Postgrest is one of the most underrated projects out right now for automating api creation. Easy to work with, reliable, and scalable. It motivated me to learn Haskell also.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#13

People might also be interested in Postgrest. Postgrest is an open-source project that creates a REST api based on a Postgres schema: https://github.com/begriffs/postgrest It ain't GraphQL, and I don't understand GraphQL enough to note functional differences. Postgrest made it extremely easy to serve a more-than-sufficient api for my db though.

Definitely, PostgREST is an awesome project and definitely an inspiration for PostGraphQL. I gave the project credit in the README: https://github.com/calebmer/postgraphql#thanks

Great work on PostGraphQL.

Easy to setup, and well documented.

I'm going to start doing some load testing, I'll let you know what I find.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#14
I know this is simple, but when you need to publish multiple versions of an API on a db, I don't see this as useful. It will only get in the way down the road of defining a strong API.

What you end up with in something like this is the data model is the API. Why not just expose SQL directly at that point? (Rhetorical question)

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#16

I know this is simple, but when you need to publish multiple versions of an API on a db, I don't see this as useful. It will only get in the way down the road of defining a strong API. What you end up with in something like this is the data model is the API. Why not just expose SQL directly at that point? (Rhetorical question)

The psql client returns a format web client cannot consume. The translation to JSON for example is really important. The reverse (speak SQL) is also quite true. That being said, my observation (and my own project too is guilty of this) is that a lot of ORM users simply map their model almost 1-1 in the API response. An example would be returning a Book the json basically contains every column as keys.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#17
post #9

With WAMP and crossbar.io, you can already directly query in SQL you PostGres db from the browser. So this does not give you real advanstages over existing solutions. The real benefit of GraphQL is that it unifies stuff: - several queries can be masqued as one; - several storages systems can be queried in one shot; - the cache layer can be integrated in the graphql server; - queries can actually no type in any backen…

Where I can see this being really useful is for people trying out GraphQL for the first time. If you already know PostgreSQL, throwing this interface over it means the GraphQL bit is the only thing you've got to learn.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#18
post #9

With WAMP and crossbar.io, you can already directly query in SQL you PostGres db from the browser. So this does not give you real advanstages over existing solutions. The real benefit of GraphQL is that it unifies stuff: - several queries can be masqued as one; - several storages systems can be queried in one shot; - the cache layer can be integrated in the graphql server; - queries can actually no type in any backen…

AGPL license is probably a non-starter for many/most potential use cases of crossbar.io. GPLv2 was fine. But GPLv3 can make one look for alternatives. AGPL will cause many to simply lose all interest. I suspect GPLv3 is why we see so much MIT/BSD/Apache licensed software these days.

Very good point.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#19
post #9

With WAMP and crossbar.io, you can already directly query in SQL you PostGres db from the browser. So this does not give you real advanstages over existing solutions. The real benefit of GraphQL is that it unifies stuff: - several queries can be masqued as one; - several storages systems can be queried in one shot; - the cache layer can be integrated in the graphql server; - queries can actually no type in any backen…

Where I can see this being really useful is for people trying out GraphQL for the first time. If you already know PostgreSQL, throwing this interface over it means the GraphQL bit is the only thing you've got to learn.

Indeed, I haven't though about that.

Re: Postgraphql: A GraphQL schema created by reflection over a PostgreSQL schema

#20
post #9

With WAMP and crossbar.io, you can already directly query in SQL you PostGres db from the browser. So this does not give you real advanstages over existing solutions. The real benefit of GraphQL is that it unifies stuff: - several queries can be masqued as one; - several storages systems can be queried in one shot; - the cache layer can be integrated in the graphql server; - queries can actually no type in any backen…

Where I can see this being really useful is for people trying out GraphQL for the first time. If you already know PostgreSQL, throwing this interface over it means the GraphQL bit is the only thing you've got to learn.

Agreed. My impression is that using this in a real project is almost a non-starter, but it's a good way for trying out GraphQL.
Post reply on HN