Introduction

Before developers like myself spend hours building and maintaing each database access API needed by the app. Even for a simple blogging app this can be hundreds of APIs for creating, updating, deleting various things.

Now with GraphJin you can write a simple GraphQL query in place of an API and GraphJin will automatically convert that into instant API endpoint by automagically converting the GraphQL into a single efficent SQL query.

Is this secure? Folks new to GraphQL might wonder how they would secure their database if users can issue GraphQL queries against it. To answer this question you have to understand that GraphJin is not a way to create dynamic GraphQL endpoints. It can only run queries you have saved to the allow list at development time. In production only queries from this allow list can be used and queries cannot be changed by the client. It is really no different than when you code up each API endpoint expect it’s faster.

Get started

Once you point GraphJin at your database you can start using GraphQL to create APIs to use with REST, GraphQL, Websockets and Go code.

Just add a .gql file ./config/queries/getPostById.sql

#import "./fragments/Post.gql"
#import "./fragments/Comment.gql"

query getPostById {
  postById(id: $id) {
    ...post
    comments(first: 10, after: $cursor) {
      ...comment
    }
    comments_cursor
  }
}

And query with REST (Example below) or GraphQL

open http://localhost:8080/api/v1/rest/getPostById?variables={"id": 123}

Quick Start

One page summary of how to get started. Quick Start →

Tutorial

Step-by-step instructions on starting a new GraphJin project. Tutorial →

Recipes

Get instructions on how to accomplish common tasks with Doks. Recipes →

In your own Code

Learn how to use GraphJin as a Go library with your own code. Go Library →

With ReactJS

Learn to use GraphJin with your ReactJS applications With React →