Skip to content

ghsable/graphql-playground.go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-playground.go

GraphQL Playground written by Go.

Screenshot01.png

Usage

$ make server

Example

erDiagram
  users {
    integer id PK "gorm.Model"
    datetime created_at "gorm.Model"
    datetime updated_at "gorm.Model"
    datetime deleted_at "gorm.Model"
    text name
    text email
    numeric is_active
  }
Loading

CREATE

mutation createUser {
  createUser(input: {
    name: "name-f",
    email: "[email protected]",
    is_active: true
  }) {
    id
    name
    email
    is_active
  }
}

READ

query readUser {
  user(is_active: true) {
    id
    name
    email
    is_active
  }
}

UPDATE

mutation updateUser {
  updateUser(input: {
    id: 6,
    name: "name-f",
    email: "[email protected]",
    is_active: false
  }) {
    id
    name
    email
    is_active
  }
}

DELETE

mutation deleteUser {
  deleteUser(input: {
    id: 6
  }) {
    id
    name
    email
    is_active
  }
}

Development

graph BT;
    Database-- response -->ORM;
    ORM-- request -->Database;
    ORM-- response -->GraphQL;
    GraphQL-- request -->ORM;
    GraphQL-- response -->User;
    User-- request -->GraphQL;
Loading
.
├── .gitignore : system
├── dev.db : human
├── go.mod : system
├── go.sum : system
├── gqlgen.yml : system
├── graph : system
│   ├── generated.go : system
│   ├── helper.go : human
│   ├── model : system
│   │   └── models_gen.go : system
│   ├── resolver.go : human
│   ├── schema.graphqls : human
│   └── schema.resolvers.go : system/human
├── LICENSE : system
├── Makefile : human
├── migrate.go : human
├── README.md : human
├── server.go : system
└── tools.go : system

GraphQL

ORM

Database

Command

  • generate

    $ make generate
  • migrate

    $ make migrate

Releases

No releases published

Packages

No packages published