【发布时间】:2018-12-13 04:38:27
【问题描述】:
我有一个用于注册的 api,它返回字符串或 null 的错误,
error: 'Email already use' or error: null
如何在模式中构造它?我现在拥有的是这样的:
const typeDefs = gql`
type Mutation {
signUp(email: String, password: String): String
}
`;
既然 typeof null 是对象,我怎样才能在 graphql 中这样呢?
signUp(email: String, password: String): String || Object
帮助?
【问题讨论】:
标签: graphql apollo-server