Before, struggle with SQL
type User struct { gorm.Model Profile Profile ProfileID int } type Profile struct { gorm.Model Name string } db.Model(&user). Related(&profile). Association("Languages"). Where("name in (?)", []string{"test"}). Joins("left join emails on emails.user_id = users.id") Find(&users) and more ...
With Super Graph, just ask.
query { user(id: 5) { id first_name last_name picture_url } posts(first: 20, order_by: { score: desc }) { slug title created_at cached_votes_total vote(where: { user_id: { eq: $user_id } }) { id } author { id name } tags { id name } } posts_cursor }
{{ feature.title }}
{{ feature.details }}
What is Super Graph?
Super Graph is a library and service that fetches data from any Postgres database using just GraphQL. No more struggling with ORMs and SQL to wrangle data out of the database. No more having to figure out the right joins or making ineffiient queries. However complex the GraphQL, Super Graph will always generate just one single efficient SQL query. The goal is to save you time and money so you can focus on you're apps core value.
Try Super Graph
Deploy as a service using docker
$ git clone https://github.com/dosco/super-graph && cd super-graph && make install
$ super-graph new blog; cd blog
$ docker-compose run blog_api ./super-graph db:setup
$ docker-compose up
Or use it with your own code
package main import ( "database/sql" "fmt" "time" "github.com/dosco/super-graph/config" "github.com/dosco/super-graph/core" _ "github.com/jackc/pgx/v4/stdlib" ) func main() { db, err := sql.Open("pgx", "postgres://postgrs:@localhost:5432/example_db") if err != nil { log.Fatalf(err) } conf, err := config.NewConfig("./config") if err != nil { log.Fatalf(err) } sg, err = core.NewSuperGraph(conf, db) if err != nil { log.Fatalf(err) } graphqlQuery := ` query { posts { id title } }` res, err := sg.GraphQL(context.Background(), graphqlQuery, nil) if err != nil { log.Fatalf(err) } fmt.Println(string(res.Data)) }
The story of {{ data.heroText }}
After working on several products through my career I find that we spend way too much time on building API backends. Most APIs also require constant updating, this costs real time and money.
It's always the same thing, figure out what the UI needs then build an endpoint for it. Most API code involves struggling with an ORM to query a database and mangle the data into a shape that the UI expects to see.
I didn't want to write this code anymore, I wanted the computer to do it. Enter GraphQL, to me it sounded great, but it still required me to write all the same database query code.
Having worked with compilers before I saw this as a compiler problem. Why not build a compiler that converts GraphQL to highly efficient SQL.
This compiler is what sits at the heart of Super Graph with layers of useful functionality around it like authentication, remote joins, rails integration, database migrations and everything else needed for you to build production ready apps with it.
It's always the same thing, figure out what the UI needs then build an endpoint for it. Most API code involves struggling with an ORM to query a database and mangle the data into a shape that the UI expects to see.
I didn't want to write this code anymore, I wanted the computer to do it. Enter GraphQL, to me it sounded great, but it still required me to write all the same database query code.
Having worked with compilers before I saw this as a compiler problem. Why not build a compiler that converts GraphQL to highly efficient SQL.
This compiler is what sits at the heart of Super Graph with layers of useful functionality around it like authentication, remote joins, rails integration, database migrations and everything else needed for you to build production ready apps with it.
GraphQL the future of APIs
Keeping a tight and fast development loop helps you iterate quickly. Leveraging technology like Super Graph focuses your team on building the core product and not reinventing wheels. GraphQL eliminate the dependency on the backend engineering and keeps the things moving fast
Build Secure Apps
More Features
{{ data.footer }}