【发布时间】:2021-10-11 13:17:35
【问题描述】:
GraphQL 允许您指定字段是否为可选(添加!)
使用 Node API,我找不到该选项。
见https://graphql.org/graphql-js/constructing-types/
我也经历了没有运气的类型
见https://github.com/graphql/graphql-js/blob/main/src/index.ts
我错过了什么?
我基本上想要
type MyEntity {
uuid: ID!
name: String!
}
而不是
type MyEntity {
uuid: ID
name: String
}
【问题讨论】:
-
optional=nullable, required .... like graphqlNotNull( type )
标签: node.js graphql graphql-js