crud

command
Version: v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 6 Imported by: 0

README

Go GraphQL CRUD example

Implement create, read, update and delete on Go.

To run the program:

  1. go to the directory: cd examples/crud
  2. Run the example: go run main.go

Create

http://localhost:8080/product?query=mutation+_{create(name:"Inca Kola",info:"Inca Kola is a soft drink that was created in Peru in 1935 by British immigrant Joseph Robinson Lindley using lemon verbena (wiki)",price:1.99){id,name,info,price}}

Read

  • Get single product by id: http://localhost:8080/product?query={product(id:1){name,info,price}}
  • Get product list: http://localhost:8080/product?query={list{id,name,info,price}}

Update

http://localhost:8080/product?query=mutation+_{update(id:1,price:3.95){id,name,info,price}}

Delete

http://localhost:8080/product?query=mutation+_{delete(id:1){id,name,info,price}}

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

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