插件配置
插件配置将 CustomPostUnion 解析为单一类型

将 CustomPostUnion 解析为单一类型

如果 CustomPostUnion 中只添加了一种类型(例如:仅 Post),则可以让解析为 CustomPostUnion 的字段直接解析为该唯一类型。

为此,请前往 Schema Custom Posts 的设置页面,点击选项 "Use single type instead of union type?"

Custom Posts 的设置
Custom Posts 的设置

例如,如果 Post 是唯一的类型,则 Root 类型的 customPosts 字段将直接解析为该类型:

customPosts 字段解析为 Post 类型