[GraphQL] Set variable and default value & alias

Posted answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[GraphQL] Set variable and default value & alias相关的知识,希望对你有一定的参考价值。

query($category:PetCategory=CAT, $status:PetStatus=AVAILABLE) 
  #availablePets is the alias
  availablePets:totalPets(status: AVAILABLE),
  #checkoutPets is the alias
  checkoutPets:totalPets(status: CHECKEDOUT),
  totalPets,
  totalCustomers,
  allPets(status: $status, category:$category) 
    category,
    name,
    weight,
    photo 
      thumb
    
  

技术图片

以上是关于[GraphQL] Set variable and default value & alias的主要内容,如果未能解决你的问题,请参考以下文章

允许哪些类型的 GraphQL 变量?

[GraphQL] Create an Input Object Type for Complex Mutations

Postman测试Graphql 接口测试与报错:Must provide an operation

Postman测试Graphql 接口测试与报错:Must provide an operation

set -- $variable

MariaDB:使用 SET @variable 从查询创建视图