MANDIC + RIVENDEL.
ESPECIALISTAS EM CLOUDS.
Minha API deve ser Rest?
Desenvolvedor
@ezidio
mandic.com.br
Everton Tavares
#EspecialistaFaz
…
https://graphql.org/
type Query {
products: [Product]
product(id:Int): [Product]
}
type Product {
id: Int
name: String
tags: [String]
price: Double
category: Category
}
type Category {
name: String
}
{
products: {
id
name
price
category: {
name
}
}
}
type Query {
products: [Product]
product(id:Int): [Product]
}
type Product {
id: Int
name: String
tags: [String]
price: Double
category: Category
}
type Category {
name: String
}
{
products: [
{
“id”: 1,
“name”: “Relogio Casio”,
“price”: 270.4,
“category”: {
“name”: “Relogio”
}
},
{ … }
]
}
type Query {
products: [Product]
product(id:Int): [Product]
}
type Product {
id: Int
name: String
tags: [String]
price: Double
category: Category
}
type Category {
name: String
}
{
product(id = 2): {
id
name
}
}
type Query {
products: [Product]
product(id:Int): [Product]
}
type Product {
id: Int
name: String
tags: [String]
price: Double
category: Category
}
type Category {
name: String
}
{
product: {
“id”: 1,
“name”: “Relogio Casio”
}
}
type Mutation {
update(id:Int, name:String): Product
delete(id:Int): Boolean
}
mutation {
update(id: 2, name: “Teste”): {
id
name
}
delete(id: 5)
}
https://netflix.github.io/falcor/
var model = new falcor.Model({
source: new HttpDataSource(baseUrl + '/model.json')
});
var jsonGraph = await model.get(["products", {from: 0, to:10},
["id","name","price"]]);
/GET?paths=[“products[0..10][‘id’,’name’,’price’”]]
{
products: [
{
“id”: 1,
“name”: “Relogio Casio”,
“price”: 270.4
},
{ … }
]
}
{
categoryById: {
"10": {
product: "Relogios",
done: false,
prerequisites: [{ $type: "ref", value: ["todosById", 54] }]
}, {...}
},
categories: [{ $type: "ref", value: ["categoryById", 10] }, { ... }],
products: [
{
id: 1
name: "Relogio Casio",
price: 270.4
category: { $type: "ref", value: ["categoryById", 10] }
},
{...}
]
}
https://jrgql.github.io/
{
“name”: “”
}
[
{
“name”: “Relogio Casio”
},
{
“name”: “Relogio Rolex”
},
{
“name”: “Relogio Pirata”
},
{ … }
]
{
“_id”: “”,
“name”: “”,
“price”: “”
}
[
{
“_id”: 1,
“name”: “Relogio Casio”,
“price”: 270.4
},
{
“_id”: 2,
“name”: “Relogio Rolex”,
“price”: 12000
},
{ … }
]
{
“_id”: “1”,
“name”: “”,
“price”: “”
}
[
{
“_id”: 1,
“name”: “Relogio Casio”,
“price”: 270.4
}
]
{
“_id”: “”,
“name”: “”,
“price<”: 500
“category”: {
“name”: “”
}
}
[
{
“_id”: 1,
“name”: “Relogio Casio”,
“price”: 270.4,
“category”: {
“name”: “Relogio”
}
}
]
https://grpc.io/
service ProductService {
rpc getProduct (ProductRequest) returns (Product) {}
}
message ProductRequest {
int32 id = 1;
}
message ProductReply {
int32 id = 1;
string name = 2;
double price = 3;
}
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?
Minha api deve ser rest?

Minha api deve ser rest?