【发布时间】:2017-05-15 21:06:32
【问题描述】:
我一直在寻找 GraphQL 在我正在从事的项目中的使用。对于该项目,我们使用 Haskell 数据类型定义了整体数据结构(用于说明目的)。这包含如下类型:
data Requirement
= Purchased PurchaseId
| Attained Outcome Real
| Invited
因此,对某事的要求可能是用户已购买某个项目、获得某个分数或被邀请。
通过阅读文档,我猜想 union 是我想要表达 type 的需求,但是有没有一种优雅的方式来处理 工会的每个成员的strong>内容?
提前致谢!
【问题讨论】:
标签: graphql