jamesfredley opened a new pull request, #15692:
URL: https://github.com/apache/grails-core/pull/15692

   ## Summary
   
   `DeleteEntityDataFetcher.deleteInstance()` called 
`instance.delete(failOnError: true)`, but GORM's `delete(Map)` only honors the 
`flush` parameter - the `failOnError` argument is silently ignored. As a result 
the data fetcher gained no error-handling benefit from it.
   
   This switches the call to `instance.delete(flush: true)`, so the delete 
executes immediately and any failure (e.g. constraint violation, optimistic 
locking) is raised at that point and surfaces through the fetcher's existing 
try/catch to `responseHandler.createResponse(env, false, exception)`. This 
matches the `flush: true` delete guidance documented in #15599.
   
   ## Changes
   
   - `DeleteEntityDataFetcher`: `delete(failOnError: true)` to `delete(flush: 
true)`.
   - `DeleteEntityDataFetcherSpec`: added an interaction test asserting 
`deleteInstance` calls `delete(flush: true)` and no longer passes the ignored 
`failOnError` argument.
   
   ## Testing
   
   ```
   ./gradlew :grails-data-graphql-core:test --tests 
"org.grails.gorm.graphql.fetcher.impl.DeleteEntityDataFetcherSpec" --tests 
"org.grails.gorm.graphql.fetcher.impl.SoftDeleteEntityDataFetcherSpec"
   ```
   
   All pass, including the existing happy-path / invalid-id cases and the 
`SoftDeleteEntityDataFetcher` (which overrides `deleteInstance`) regression 
check.
   
   Flagged during review of #15599.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to