[GraphQL] Query Lists of Multiple Types using a Union in GraphQL
Posted answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[GraphQL] Query Lists of Multiple Types using a Union in GraphQL相关的知识,希望对你有一定的参考价值。
Unions are used when we want a GraphQL field or list to handle multiple types of data. With a Union Type, we can define a field that could resolve completely different types of data. In this lesson, we will write a query that obtains a list of different pet types
Unit type, we cannot use common field in query, I have to write in fragment:
# Write your query or mutation here
query
familyPets
__typename,
... on Cat
name
,
... on Dog
name
以上是关于[GraphQL] Query Lists of Multiple Types using a Union in GraphQL的主要内容,如果未能解决你的问题,请参考以下文章
160. Intersection of Two Linked Lists
更新到 Laravel 5.3 后播种时调用未定义的方法 Illuminate\Database\Query\Builder::lists()
将 ResultSet 变成 2DArray/HashMap/Lists of Lists
LeetCode Minimum Index Sum of Two Lists