graphql-playground.go

module
v0.0.0-...-2ea8f43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: MIT

README

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
  }
CREATE
mutation createUser {
  createUser(input: {
    name: "name-f",
    email: "f@xxx.com",
    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: "f@xxx.com",
    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;
.
├── .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
    

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL