【发布时间】:2021-09-02 07:33:04
【问题描述】:
我正在尝试所有最新版本的 apollo-ios,但我想解决这个挥之不去的问题:我不断获得可选值(见下图)。
这是我探索过的(但仍然找不到原因)
当我创建表时,Nullable 为 false。然后,我创建了一个供公众访问的视图。
使用 apollo schema:download 命令,生成的 json 如下:schema.json
使用 graphqurl 命令,生成的 schema.graphql 如下:schema.graphql。这是sn-p。
"""
columns and relationships of "schedule"
"""
type schedule {
activity: String
end_at: timestamptz
id: Int
"""An array relationship"""
speakers(
"""distinct select on columns"""
distinct_on: [talk_speakers_view_select_column!]
"""limit the number of rows returned"""
limit: Int
"""skip the first n rows. Use only with order_by"""
offset: Int
"""sort the rows by one or more columns"""
order_by: [talk_speakers_view_order_by!]
"""filter the rows returned"""
where: talk_speakers_view_bool_exp
): [talk_speakers_view!]!
start_at: timestamptz
talk_description: String
talk_type: String
title: String
}
我怀疑 id: Int 在架构中缺少 !,这是 codegen 将其解释为可选的原因。但我也可能是错的。这是完整参考的 repo https://github.com/vinamelody/MyApolloTest/tree/test
【问题讨论】: