Slide 11
Slide 11 text
ྫ Sangria - resolveͷઃఆ-
ैདྷͷσʔλϑΣον GraphQL
{ࡾ}
GET /v1/persons
GET /v2/accounts
POST /application
POST /application
POST /graphql
εΩʔϚఆٛ
val Id = Argument("id", StringType)
val QueryType = ObjectType("Query", fields[ProductRepo, Unit](
Field("product", OptionType(ProductType),
description =
Some("Return a product with specific `id`.”),
arguments = Id :: Nil,
resolve = c 㱺 c.ctx.product(c arg Id))),
Field("products", ListType(ProductType),
description =
Some("Returns a list of all available products."),
resolve = _.ctx.products)))