01-basic-api

command
v0.0.0-...-fc75448 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 7 Imported by: 0

README

basic api by graphql with golang

通过graphiql 请求

graphiql

通过postman 请求

postman-graphql

curl 无参数请求

➜ curl -XGET http://localhost:3000/graphql -d'{"query":"{jobs{id,company}}"}'
{"data":{"jobs":[{"company":"Apple","id":1},{"company":"Google","id":2},{"company":"Microsoft","id":3},{"company":"Facebook","id":4},{"company":"Facebook","id":5}]}}     

curl 带参数请求

➜ curl -XGET http://localhost:3000/graphql -d'{"query":"{job(id:3){id,company}}'                                    
{"data":{"job":{"company":"Microsoft","id":3}}}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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