标签:sch into style http ESS input tst spec message
说明:使用docker-compose 进行安装
使用命令行工具创建
qlooctl install docker qloo-docker
cd ./qloo-docker
docker-compose up
https://github.com/solo-io/qloo/releases
https://github.com/solo-io/gloo/releases
mac
cat ~/.bash_profile
export PATH=$PATH:/Users/dalong/Downloads/qloo
docker run -d -p 1234:8080 soloio/petstore-example:latest
使用使用命令行工具,或者直接编写文件,注意qloo-docker_default 或者根据目录命名修改
- 使用glooctl
cat << EOF | glooctl upstream create -f -
name: petstore
type: static
spec:
hosts:
# gateway ip for the docker network
- addr: $(docker inspect qloo-docker_default -f ‘{{ (index .IPAM.Config 0).Gateway }}‘)
port: 1234
EOF
cat > ./_gloo_config/upstreams/petstore.yaml << EOF
name: petstore
type: static
spec:
hosts:
# gateway ip for the docker network
- addr: $(docker inspect qloo-docker_default -f ‘{{ (index .IPAM.Config 0).Gateway }}‘)
port: 1234
EOF
glooctl upstream get
效果
# The query type, represents all of the entry points into our object graph
type Query {
pets: [Pet]
pet(id: Int!): Pet
}
type Mutation {
addPet(pet: InputPet!): Pet
}
type Pet{
id: ID!
name: String!
status: Status!
}
input InputPet{
id: ID!
name: String!
tag: String
}
enum Status {
pending
available
}
qlooctl schema create petstore -f petstore.graphql
qlooctl resolvermap get petstore-resolvers -o yaml
效果
# register findPetById for Query.pets (specifying no arguments)
qlooctl resolvermap register -u petstore -f findPetById Query pets
# register a resolver for Query.pet
qlooctl resolvermap register -u petstore -f findPetById Query pet
# register a resolver for Mutation.addPet
# the request template tells QLoo to use the Variable "pet" as an argument
qlooctl resolvermap register -u petstore -f addPet Mutation addPet --request-template ‘{{ marshal (index .Args "pet") }}‘
https://github.com/solo-io/qloo/blob/master/docs/getting_started/docker/1.md
https://qloo.solo.io/
QLoo graphql engine 学习一 基本试用(docker&&docker-compose)
标签:sch into style http ESS input tst spec message
原文地址:https://www.cnblogs.com/rongfengliang/p/9403322.html