jamesfredley commented on PR #15587:
URL: https://github.com/apache/grails-core/pull/15587#issuecomment-4322481049

   Pushed `ef154b78ed` adding a `gorm-graphql` feature to Grails Forge so users 
can opt into the newly-integrated `grails-data-graphql` plugin from the Forge 
UI / CLI / API the same way they already opt into Hibernate or MongoDB.
   
   ## Investigation
   
   I checked git history on `apache/grails-core` and the legacy 
`apache/grails-forge` repo (6.0.x, 6.1.x, 6.2.x, 7.0.x, dev branches) - **a 
Forge feature for graphql had never been added in either**. The neighbouring 
data-layer features that exist are `HibernateGorm`, `MongoGorm`, and (only on 
the legacy 6.x branches) `Neo4jGorm`. So this is a brand-new feature, modelled 
after the Hibernate/Mongo ones.
   
   ## What the feature does
   
   `GraphqlGorm` 
(`grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/GraphqlGorm.java`):
   
   - `name = "gorm-graphql"`, `title = "GORM for GraphQL"`, `category = 
Category.API`
   - Selectable in addition to (not instead of) a GORM persistence 
implementation, since GraphQL is a layer on top of GORM rather than a competing 
GORM provider
   - If the user opts into `gorm-graphql` without explicitly choosing Hibernate 
or MongoDB, Hibernate is added as a sensible default via 
`processSelectedFeatures(...)` (mirroring `HibernateGorm`'s default-DB-driver 
handling)
   - Restricted to `WEB` and `REST_API` application types - the `WEB_PLUGIN` 
and `PLUGIN` skeletons don't make sense for an API endpoint
   - Adds the `org.apache.grails:grails-data-graphql` `implementation` 
dependency
   - Returns `https://graphql.org` from `getThirdPartyDocumentation()`
   
   The new feature is auto-discovered by Micronaut's `@Indexed(Feature.class)` 
machinery, so just creating the `@Singleton` class registers it in the 
available-features index that the Forge UI/CLI consume.
   
   ## Test coverage
   
   `GraphqlGormSpec` (`.../test/groovy/.../GraphqlGormSpec.groovy`) covers:
   
   1. `gorm-graphql` is registered and resolvable from the AvailableFeatures 
index
   2. Selecting `gorm-graphql` alone falls back to `gorm-hibernate5`
   3. Selecting `gorm-graphql` with `gorm-mongodb` (and 
`Options(GormImpl.MONGODB)`) keeps Mongo and does NOT pull Hibernate
   4. Category is `API`
   5. Supports `WEB` and `REST_API` only - rejects both `*_PLUGIN` types
   6. The rendered Gradle `build.gradle` template contains `implementation 
"org.apache.grails:grails-data-graphql"`
   7. `apply(...)` does not require any extra `application.yml` config (the 
plugin auto-configures itself)
   
   ## Verified
   
   ```
   ./gradlew :grails-forge-core:test --tests *GraphqlGormSpec   # 7/7 pass
   ./gradlew :grails-forge-core:test                            # full module 
BUILD SUCCESSFUL
   ```
   
   CI on the new commit is green: 32 pass / 4 skip (publish-only) / 0 fail.
   


-- 
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