Nullable property-constraint ignored
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
Hi!
I set up an example Grails Application project following [this guide](https://grails.github.io/gorm-graphql/2.0.0/guide/index.html), however when setting the `firstName` property as not nullable this constraint is not respected, GraphiQL displays it as a nullable field in the `SpeakerCreate` type.
```groovy
static constraints = {
firstName nullable: false
email nullable: true, email: true
bio nullable: true
}
static graphql = GraphQLMapping.build {
property('firstName',
[
order : 2,
description: 'Author first name'
nullable: false'
])
}
```

Only if I remove the entire property mapping is the nullable constraint respected, but this prevents me from mapping the property with a custom order and description.
```groovy
static constraints = {
firstName nullable: false
email nullable: true, email: true
bio nullable: true
}
static graphql = GraphQLMapping.build {
/*property('firstName',
[
order : 2,
description: 'Author first name'
nullable: false'
])*/
}
```

Thanks in advance
Contributor guide
Research direction
Start with the linked GORM GraphQL guide and reproduce the example using the shown Groovy constraints and GraphQLMapping property mapping. Inspect how GraphiQL exposes the SpeakerCreate field when a custom order and description are present. Done means firstName remains non-nullable while retaining its custom mapping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, groovy
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100