Nested fields in array/group are nullable in GraphQL-schema when required #3242
-
Hi! We've got a lot of collection types with arrays/groups in them, allowing our users to create a dynamic set of items within a specific collection item. We've got an issue with the GraphQL schema though, perhaps someone can help us out here... Fields that are immediately under a CollectionConfig-type and are marked required neatly show up as required in the schema. Fields that are within an array/group are not though. An example, the following config: const Example: CollectionConfig = {
slug: "examples",
fields: [
{
name: "direct",
type: "text",
required: true,
},
{
type: "group",
name: "group",
fields: [
{
name: "inAGroup",
type: "text",
required: true,
},
],
},
{
name: "array",
type: "array",
fields: [
{
name: "nested",
type: "text",
required: true,
},
],
},
],
}; results in the following schema: type Example {
id: String
direct: String!
group: Example_Group
array: [Example_Array!]
updatedAt: DateTime
createdAt: DateTime
}
type Example_Group {
inAGroup: String
}
type Example_Array {
nested: String
id: String
} As you can see, the Is there a way to make the nested- and inAGroup-field non-nullable as well? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This turned out to be a bug for which I made a report and a fix (#3259). That issue ahs now been merged and included in release 1.15.4 |
Beta Was this translation helpful? Give feedback.
This turned out to be a bug for which I made a report and a fix (#3259).
That issue ahs now been merged and included in release 1.15.4