Device
在我的Prisma服务器上
type Device {
id: ID! @unique
type: DeviceType
settings: Json
}
# import Node from './generated/prisma.graphql'
type MobileSettings {
firmware: String
}
type DesktopSettings {
os: String
}
union Settings = MobileSettings | DesktopSettings
type Device implements Node {
id: ID!
type: DeviceType
settings: Json
}
type Query {
devices: [Device]
node(id: ID!): Node
}
如果我在
Device.settings
字段,获取所有设备的初始查询仍尝试检索设置字段。
如何将Json字段解析为实际的联合类型?