[GraphQL] Query Lists of Multiple Types using a Union in GraphQL
in of Using Query multiple types union GraphQL
2023-09-14 09:00:48 时间
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
}
}
}
相关文章
- FIST! FIST! FIST! Its all in the wrist: Remote Exec[通俗易懂]
- 前端测试题:关于for、for-in、for-of说法不正确的是?
- vue的 v-for指令报“custom elements in iteration require v-bind:key“错误
- ORA-19275: XQST0055 – schema path string not found in list of in-scope schema definitions ORACLE 报错 故障修复 远程处理
- ORA-19729: File string is not the initial version of the plugged in datafile ORACLE 报错 故障修复 远程处理
- ORA-26027: unique index string.string partition string initially in unusable state ORACLE 报错 故障修复 远程处理
- ORA-29920: failed in the partition maintenance operation of secondary table ORACLE 报错 故障修复 远程处理
- ORA-29961: too many warnings occurred in the execution of ODCIIndex DDL routine ORACLE 报错 故障修复 远程处理
- ORA-39911: Index string.string in tablespace string points to partition string of table string.string in tablespace string outside of transportable set. ORACLE 报错 故障修复 远程处理
- ORA-48444: The single “.” and “*” cannot appear in the middle of the path ORACLE 报错 故障修复 远程处理
- ORA-01792: maximum number of columns in a table or view is 1000 ORACLE 报错 故障修复 远程处理
- MySQL:The Power of Data in Your Hands(mysqlliek)
- 和existsMySQL首选:少用IN和EXISTS方法(mysql少用in)
- Exploring the Benefits of Using htonl Function in Linux Networking(linuxhtonl)
- Exploring the Power of Pointers in Linux Development: A Comprehensive Guide to Using 64Bit Pointers(64linux指针)
- 操作Oracle中掌握字符串IN操作的技巧(oracle中字符串in)
- 在Oracle数据库中优化IN子句(oracle中in优化)