HN user

gsvclass

191 karma

https://twitter.com/dosco

https://github.com/dosco/super-graph

Posts28
Comments68
View on HN
github.com 3y ago

Show HN: Create REST APIs with just a simple GraphQL query.

gsvclass
5pts0
cryptogood.substack.com 4y ago

ReFi Movement: Helping People and the Planet

gsvclass
1pts0
old.reddit.com 4y ago

Secure Key Management in GraphJin the Instant GraphQL to SQL Service

gsvclass
1pts0
cryptogood.substack.com 5y ago

GiveTrack: A Bitcoin Crowdfunding Platform for Nonprofits

gsvclass
1pts0
cryptogood.substack.com 5y ago

Vitalik Buterin just made a 1B dollar donation for India Covid Relief

gsvclass
2pts1
github.com 5y ago

GraphQL to SQL Compiler in Go (Postgres and MySQL) – GraphJin

gsvclass
1pts0
42papers.com 5y ago

Software Engineering at Google

gsvclass
1pts0
42papers.com 5y ago

Password Cracking with Deep Learning

gsvclass
10pts0
42papers.com 5y ago

REST vs. GraphQL – A search for evidence on which is better

gsvclass
184pts237
42papers.com 5y ago

Show HN: Discover the latest trending papers in AI and Computer Science

gsvclass
5pts0
anchor.fm 6y ago

Show HN: A Podcast on Distributed Computing. Deep Technical Conversations

gsvclass
3pts0
news.ycombinator.com 6y ago

New Podcast on Distributed Data Systems and Cloud Computing

gsvclass
1pts0
news.ycombinator.com 6y ago

Use GraphQL instead of SQL to fetch complex related data from your DB in GO

gsvclass
1pts5
supergraph.dev 6y ago

Build infinite scroll with Super Graph cursor pagination

gsvclass
2pts0
supergraph.dev 6y ago

Show HN: An Instant Go Powered GraphQL API for Postgres. No Code Needed

gsvclass
11pts3
movnorth.com 8y ago

Show HN: MOV North, Helps Canadian companies hire global software developers

gsvclass
2pts0
twitter.com 8y ago

Why H1Bs Need to Take Toronto Seriously – Twitter Thread

gsvclass
2pts0
42markets.com 8y ago

VueJS+D3+Golang Cryptocurrency Prices for all exchange traded tokens – 42Markets

gsvclass
2pts1
42markets.com 8y ago

Crypto Currency Markets Data Visualization

gsvclass
2pts1
movnorth.com 8y ago

A Tech Nomad's Toronto Experience

gsvclass
4pts0
movnorth.com 9y ago

My Story Indian on H1B to a Canadian Permanent Resident and Startup Founder

gsvclass
3pts0
movnorth.com 9y ago

From H1B in Silicon Valley to PR in Toronto My Experience Moving

gsvclass
3pts0
github.com 9y ago

Open Source Ethereum HD Wallet

gsvclass
3pts0
42wallet.com 9y ago

Show HN: 42Wallet – An Ethereum HD wallet that's secure and easy to use

gsvclass
1pts0
medium.com 9y ago

How I Built a Serverless Startup – The story of the tech behind Bell+Cat

gsvclass
1pts0
medium.com 9y ago

Create a Personal CRM with Your LinkedIn Connections

gsvclass
1pts0
webmatr.com 9y ago

Show HN: Webmatr – It's Like IFTTT or Zapier but for Programmers

gsvclass
5pts1
bellpluscat.com 9y ago

Show HN: Bell+Cat – A database in your browser. Saves to Google Drive

gsvclass
3pts3

In GraphJin an automatic GraphQL to SQL compiler we use the gnomock library it startups a database instance (docker) then create the schema and tests data and finally our code connects to it and runs a series of tests. We run these across Mysql, Postgres and a few other DB's. Gnomock supports a wide range of them. Right now we don't take down the db for every test only between test runs but its fast enough that we could. This whole thing runs of a simple `go test -v .` command and we run it on every commit using a githook. https://github.com/dosco/graphjin/blob/master/tests/dbint_te...

For Want of a JOIN 4 years ago

This is more common that you would believe other issues i've seen are no `limit` on the query, fetching all the results and then sorting in your own app code, using wrong joins. Many of these happen while using ORMs as well. SQL is a context switch for more devs and very few understand it and even those that do might not be familiar with the capabilites of your startups db choice.

Shameless plug but this was my motivation behind building GraphJin a GraphQL to SQL compiler and it's my single goto force multipler for most projects. https://github.com/dosco/graphjin

GraphQL takes security pretty seriously the way we think of GraphQL as a DSL for bulding APIs. The queries you issue in DEV are saved to an allow list and only those queries are compiled in production. Any other queries (or changes to existing queries) from the client is ignore. So you can use it to expose your primary DB. It's really no different that you writing code to build an HTTP endpoint, except of-course here you only write GraphQL

Author of GraphJin here, thanks for all the comments on here. It's a labour of love for me over several years. Today it's so useful to me and other that I'm probably going to work on it forever. GraphJin is used as the backend for my startup https://42papers.com a site to discover and read top trending research papers in CS, DL, ML, and other fields.

+1 to that additionally there is nothing like subscriptions, defer, async on the REST side of things. These are really great capabilities to have towards building snappy data rich apps.

I won't comment on GraphQL itself. But GraphJin builds an internal graph of your db relationships, etc and uses that to write a single efficient query. Even if you have a deeply nested query, insert or update it will only result in a single efficient SQL query. Additionally we also support GraphQL subscriptions out of the box and soon, defer and async as well allowing you to build live updating apps using the same GraphQL queries.

You can do this with GraphJin. We support adding custom resolvers currently we have an HTTP resolver built in which allows you to join your DB GraphQL query with a remote HTTP Rest endpoint. For example you want users from your db and their subscription data from Stripe. It works out of the box, GraphJin will write out the correct Rest call using data from the db call eg stripe_customer_id from the db will be inserted into the rest calls. Additionally its smart enough to handle rate limits and parallel fetches if required.

Here's an example https://pkg.go.dev/github.com/dosco/graphjin/core#example-pa...

And here's an example of a Redis custom resolver to join with data from Redis. https://pkg.go.dev/github.com/dosco/graphjin/core#Resolver

Happy you're sharing this on here, glad to have more options on the table. However I will say GraphJin is not complex to use nor does it have any boilerplate. It's feature rich and hence has knobs to help you tune it to your needs. However it's defaults are well thought out and so should work out of the box in most cases. For example to use GraphJin as a library in your own code this is all it takes.

Here's a quick example of using it as a library in your own code.

https://gist.github.com/dosco/2422006fe322bd81c00988570f50a5...

GraphJin DOES NOT hook GraphQL straight to a DB. It is a backend service which in DEV mode saves queries to an allow list and in production on queries from this list are allowed to be run. GraphQL does not mean clients are allowed to change the query willy nilly in production that would be a nightmare.

Also in production the query is compiled into a db prepared statement the first time and then on queries after validation go directly to the prepared statement. This is no different than a hand written HTTP endpoint + ORM.

Addition if using the standalone service is not for you then you can use GraphJin as sort of an ORM within your own http handlers.

The question around why use it is complex. Some reasons even nested queries and mutations are compiled to a single SQL query. Knowledge of indexes is used to write a fast query. Support for things like joining again Postgres Array columns, JSON columns, fast cursor pagination, Graph queries using recursive CTEs, full-text search and a lot more out of the box and will work on Postgres, Mysql, Cockroach, Yugabyte and I'm working on more.

Also GraphJin is the only one built in Go and therefore can be used as a library within your own Go app allowing you to use it while also adding any business logic you might need.

GraphJin does auto db discovery and hence builds a relationship graph which it then uses to write out a single efficient sql query for any Graphql query or mutation even nested ones. As GraphJin improves and uses new capabilities of newer versions of the db you get that for free. In the backend your query is compiled only the first time into a prepared statement and from then on requests pretty much go directly to db.

No real issues have been closed cursor pagination has been working for years. This issue clear says "frederikhors closed this as completed on Mar 3, 2020" as in closed by the person who opened it.

In Go you can use GraphJin an automatic GraphQL to SQL compiler that supports GraphQL subscriptions (aka Live Queries). GraphJin works either as a standalone service or as a library in your own code. It uses a very efficient mechanism to manage subscriptions keeping db load low while subscribing to an SQL query using polling.

https://pkg.go.dev/github.com/dosco/graphjin@v0.16.44/core#e...

https://github.com/dosco/graphjin

I love this post. I'm a big believer that one and two man startups will continue to build more and more impressive products. My one man startup 42papers.com (A community for top trending papers in CS/DL/ML) has the following stack.

  1. Firebase Hosting for the React frontend
  2. GraphJin (Automatic GraphQL to SQL Engine) on App Engine for the backend
  3. Cloud SQL Postgres for DB
https://github.com/dosco/graphjin