jamesfredley commented on code in PR #15587:
URL: https://github.com/apache/grails-core/pull/15587#discussion_r3144288205


##########
grails-test-examples/graphql/spring-boot-app/build.gradle:
##########
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+// Standalone Spring Boot demo that embeds GORM-GraphQL without a full
+// Grails application; exercises the schema generator core library directly.
+
+plugins {
+    id 'groovy'
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.springframework.boot'
+    id 'org.apache.grails.buildsrc.compile'
+}
+
+version = projectVersion
+group = 'examples'
+
+dependencies {
+
+    implementation platform(project(':grails-bom'))
+
+    implementation 'org.springframework.boot:spring-boot-starter'
+    implementation 'org.springframework.boot:spring-boot-starter-web'
+
+    // GORM + Hibernate 5 (Jakarta variant), configured via GORM's Spring Boot 
auto-config
+    // (registers HibernateDatastore, dataSource, transactionManager as Spring 
beans).
+    implementation project(':grails-data-hibernate5-spring-boot')

Review Comment:
   Done in d695a96152. The four project(":grails-data-hibernate5-spring-boot" / 
"-core"), project(":grails-datamapping-core"), and 
project(":grails-data-graphql-core") references are now published Maven 
coordinates (org.apache.grails:grails-data-hibernate5-spring-boot, 
org.apache.grails.data:grails-data-hibernate5-core, 
org.apache.grails.data:grails-datamapping-core, 
org.apache.grails.data:grails-data-graphql-core). The four Grails apps 
similarly switched project(":grails-data-graphql") to 
org.apache.grails:grails-data-graphql. Only :grails-bom is referenced via 
project(...) anywhere now. Resolving.



##########
grails-test-examples/graphql/grails-tenant-app/build.gradle:
##########
@@ -0,0 +1,81 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+plugins {
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.buildsrc.compile'
+}
+
+version = projectVersion
+group = 'examples'
+
+apply plugin: 'groovy'
+apply plugin: 'org.apache.grails.gradle.grails-web'
+apply plugin: 'org.apache.grails.gradle.grails-gson'
+
+dependencies {
+    implementation platform(project(':grails-bom'))
+
+    implementation 'org.springframework.boot:spring-boot-starter-logging'
+    implementation 'org.springframework.boot:spring-boot-autoconfigure'
+    implementation 'org.springframework.boot:spring-boot-starter-actuator'
+    implementation 'org.springframework.boot:spring-boot-starter-tomcat'
+
+    implementation 'org.apache.grails:grails-core'
+    implementation 'org.apache.grails:grails-url-mappings'
+    implementation 'org.apache.grails:grails-rest-transforms'
+    implementation 'org.apache.grails:grails-codecs'
+    implementation 'org.apache.grails:grails-interceptors'
+    implementation 'org.apache.grails:grails-services'
+    implementation 'org.apache.grails:grails-datasource'
+    implementation 'org.apache.grails:grails-databinding'
+    implementation 'org.apache.grails:grails-web-boot'
+    implementation 'org.apache.grails:grails-logging'
+    implementation 'org.apache.grails:grails-cache'
+    implementation 'org.apache.grails:grails-async'
+    implementation 'org.apache.grails:grails-events'
+    implementation 'org.apache.grails:grails-data-hibernate5'
+    implementation 'org.apache.grails:grails-views-gson'
+    implementation 'org.apache.grails:grails-data-mongodb-gson-templates'
+
+    implementation "org.hibernate:hibernate-core-jakarta:$hibernate5Version"
+    implementation 
"io.micronaut.rxjava2:micronaut-rxjava2-http-client:$micronautRxjava2Version"
+    // JSON mapper for the micronaut HTTP client used by the GraphQLSpec trait.
+    implementation 
"io.micronaut.serde:micronaut-serde-jackson:$micronautSerdeJacksonVersion"
+
+    implementation project(':grails-data-graphql')
+
+    console 'org.apache.grails:grails-console'
+    profile 'org.apache.grails.profiles:rest-api'
+
+    runtimeOnly 'com.h2database:h2'
+    runtimeOnly 'org.apache.tomcat:tomcat-jdbc'
+
+    testImplementation 'org.apache.grails:grails-testing-support-datamapping'
+    testImplementation 'org.apache.grails:grails-testing-support-web'
+}
+
+bootRun {
+    jvmArgs('-Dspring.output.ansi.enabled=always')

Review Comment:
   ootRun {} block removed in d695a96152. Resolving.



##########
grails-data-graphql/plugin/build.gradle:
##########
@@ -17,37 +17,98 @@
  *  under the License.
  */
 
-
 plugins {
-    id "org.apache.grails.gradle.grails-plugin"
-    id "org.apache.grails.gradle.grails-gson"
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.gradle.grails-plugin'
+    id 'org.apache.grails.gradle.grails-gson'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    gormApiDocs = true
+    pomTitle = 'GORM for GraphQL'
+    pomDescription = 'Generates a GraphQL schema based on entities in GORM'
 }
 
 dependencies {
-    api "org.apache.grails:grails-controllers"
-    api "org.apache.grails:grails-databinding"
-    api("org.apache.grails:grails-rest-transforms") {
+
+    implementation platform(project(':grails-bom'))
+
+    api project(':grails-data-graphql-core'), {
+        // api: GraphQLEntityNamingConvention, Schema, GraphQLSchema generation
+    }
+    api project(':grails-controllers'), {
+        // api: GraphqlController extends from grails controller infrastructure
+    }
+    api project(':grails-databinding'), {
+        // api: data binding for GraphQL request payloads
+    }
+    api project(':grails-rest-transforms'), {
+        // api: REST transforms used for JSON marshalling
         exclude group: 'org.apache.grails', module: 'grails-converters'
     }
-    api "org.apache.grails:grails-url-mappings"
-    api "org.apache.grails:grails-views-gson:$viewsJsonVersion"
-    api 'io.micronaut.rxjava2:micronaut-rxjava2-http-client:1.3.0'
-    api "javax.servlet:javax.servlet-api:$servletApiVersion"
-    api "io.micronaut:micronaut-http-client:$micronautVersion"
-    api "org.apache.grails:grails-converters:3.3.1"
-    api 'com.github.javaparser:javaparser-core:3.25.7'
-    api "com.graphql-java:graphql-java:$graphqlJavaVersion"
-    testImplementation "org.apache.grails:grails-testing-support-web"
-    testImplementation "cglib:cglib-nodep:3.3.0"
-    profile "org.apache.grails.profiles:web-plugin"
+    api project(':grails-url-mappings'), {
+        // api: URL mappings for /graphql endpoint
+    }
+    api project(':grails-converters'), {
+        // api: JSON converters used by the controller
+    }
+    api project(':grails-views-gson'), {
+        // api: GSON view rendering for GraphQL responses
+    }
+    api 'com.github.javaparser:javaparser-core', {
+        // api: parsing of GORM entity sources for schema introspection
+    }
+    api "com.graphql-java:graphql-java:$graphqlJavaVersion", {
+        // api: GraphQL execution and schema types
+    }
+    api 'jakarta.servlet:jakarta.servlet-api', {
+        // api: HttpServletRequest/Response in GraphqlController
+    }
+    api "io.micronaut:micronaut-http-client:$micronautHttpClientVersion", {
+        // api: HTTP client used by integration tests / playground
+    }
+    api 
"io.micronaut.rxjava2:micronaut-rxjava2-http-client:$micronautRxjava2Version", {
+        // api: RxJava2 variant of micronaut-http-client used by integration 
tests
+    }
 
-    api project(":gorm-graphql")
+    testImplementation project(':grails-testing-support-web')
+    // Spock 2.3 on Groovy 4 / JDK 17 uses net.bytebuddy for class mocking;
+    // cglib-nodep no longer works on JDK 17+.

Review Comment:
   Removed in d695a96152. Resolving.



##########
grails-data-graphql/plugin/build.gradle:
##########
@@ -17,37 +17,98 @@
  *  under the License.
  */
 
-
 plugins {
-    id "org.apache.grails.gradle.grails-plugin"
-    id "org.apache.grails.gradle.grails-gson"
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.gradle.grails-plugin'
+    id 'org.apache.grails.gradle.grails-gson'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    gormApiDocs = true
+    pomTitle = 'GORM for GraphQL'
+    pomDescription = 'Generates a GraphQL schema based on entities in GORM'
 }
 
 dependencies {
-    api "org.apache.grails:grails-controllers"
-    api "org.apache.grails:grails-databinding"
-    api("org.apache.grails:grails-rest-transforms") {
+
+    implementation platform(project(':grails-bom'))
+
+    api project(':grails-data-graphql-core'), {
+        // api: GraphQLEntityNamingConvention, Schema, GraphQLSchema generation
+    }
+    api project(':grails-controllers'), {
+        // api: GraphqlController extends from grails controller infrastructure
+    }
+    api project(':grails-databinding'), {
+        // api: data binding for GraphQL request payloads
+    }
+    api project(':grails-rest-transforms'), {
+        // api: REST transforms used for JSON marshalling
         exclude group: 'org.apache.grails', module: 'grails-converters'
     }
-    api "org.apache.grails:grails-url-mappings"
-    api "org.apache.grails:grails-views-gson:$viewsJsonVersion"
-    api 'io.micronaut.rxjava2:micronaut-rxjava2-http-client:1.3.0'
-    api "javax.servlet:javax.servlet-api:$servletApiVersion"
-    api "io.micronaut:micronaut-http-client:$micronautVersion"
-    api "org.apache.grails:grails-converters:3.3.1"
-    api 'com.github.javaparser:javaparser-core:3.25.7'
-    api "com.graphql-java:graphql-java:$graphqlJavaVersion"
-    testImplementation "org.apache.grails:grails-testing-support-web"
-    testImplementation "cglib:cglib-nodep:3.3.0"
-    profile "org.apache.grails.profiles:web-plugin"
+    api project(':grails-url-mappings'), {
+        // api: URL mappings for /graphql endpoint
+    }
+    api project(':grails-converters'), {
+        // api: JSON converters used by the controller
+    }
+    api project(':grails-views-gson'), {
+        // api: GSON view rendering for GraphQL responses
+    }
+    api 'com.github.javaparser:javaparser-core', {
+        // api: parsing of GORM entity sources for schema introspection
+    }
+    api "com.graphql-java:graphql-java:$graphqlJavaVersion", {
+        // api: GraphQL execution and schema types
+    }
+    api 'jakarta.servlet:jakarta.servlet-api', {
+        // api: HttpServletRequest/Response in GraphqlController
+    }
+    api "io.micronaut:micronaut-http-client:$micronautHttpClientVersion", {
+        // api: HTTP client used by integration tests / playground

Review Comment:
   Agreed. Both micronaut HTTP clients are no longer on the pi (or 
implementation) configuration in d695a96152 - the rxjava2 one is compileOnly 
(only needed to compile the GraphQLSpec trait) and the example apps add it 
themselves at the test classpath level. Production apps no longer get a 
transitive micronaut HTTP client. Resolving.



##########
grails-data-graphql/plugin/grails-app/controllers/org/grails/gorm/graphql/plugin/GraphqlController.groovy:
##########
@@ -96,14 +96,22 @@ class GraphqlController {
     def browser() {
         if (grailsGraphQLConfiguration.enabled && 
grailsGraphQLConfiguration.browser) {
             if (resolvedBrowserHtml == null) {
+                InputStream resource = 
this.class.classLoader.getResourceAsStream('graphiql.html')
+                if (resource == null) {
+                    // The bundled GraphiQL assets (graphiql.html/css/js) were 
removed

Review Comment:
   Yes - this action originally rendered an embedded GraphiQL playground 
(graphiql.html + bundled CSS/JS) so consumers could exercise their schema in a 
browser without standing up Apollo Studio etc. Upstream commit a9b9fa2598 
deleted those bundled assets, so today the action returns 404 unless the host 
application provides its own graphiql.html on the classpath.
   
   Two reasonable paths from here:
   
   1. **Keep it (current state).** Action is harmless when no asset is present, 
gives apps a low-effort hook to drop in the latest GraphiQL build themselves.
   2. **Drop it entirely.** GraphiQL is widely available as a standalone tool 
now (browser extensions, IDE plugins, graphql-playground), so shipping a 
controller for it has limited value.
   
   Happy to do either. I left it as-is in d695a96152 (option 1) since we hadn't 
agreed on a direction. Let me know which way you want to go and I'll follow up.



##########
grails-test-examples/graphql/spring-boot-app/build.gradle:
##########
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+// Standalone Spring Boot demo that embeds GORM-GraphQL without a full
+// Grails application; exercises the schema generator core library directly.
+
+plugins {
+    id 'groovy'

Review Comment:
   Done in d695a96152. The four Grails example apps (grails-test-app, 
grails-docs-app, grails-tenant-app, grails-multi-datastore-app) all moved their 
plugin declarations into a single plugins {} block (groovy + buildsrc + 
grails-web + grails-gson + buildsrc.compile), dropping the trailing pply 
plugin: lines. Now consistent with spring-boot-app and 
grails-test-examples/hibernate5/grails-hibernate. Resolving.



##########
grails-data-graphql/plugin/build.gradle:
##########
@@ -17,37 +17,98 @@
  *  under the License.
  */
 
-
 plugins {
-    id "org.apache.grails.gradle.grails-plugin"
-    id "org.apache.grails.gradle.grails-gson"
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.gradle.grails-plugin'
+    id 'org.apache.grails.gradle.grails-gson'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    gormApiDocs = true
+    pomTitle = 'GORM for GraphQL'
+    pomDescription = 'Generates a GraphQL schema based on entities in GORM'
 }
 
 dependencies {
-    api "org.apache.grails:grails-controllers"
-    api "org.apache.grails:grails-databinding"
-    api("org.apache.grails:grails-rest-transforms") {
+
+    implementation platform(project(':grails-bom'))
+
+    api project(':grails-data-graphql-core'), {
+        // api: GraphQLEntityNamingConvention, Schema, GraphQLSchema generation
+    }
+    api project(':grails-controllers'), {
+        // api: GraphqlController extends from grails controller infrastructure
+    }
+    api project(':grails-databinding'), {
+        // api: data binding for GraphQL request payloads
+    }
+    api project(':grails-rest-transforms'), {
+        // api: REST transforms used for JSON marshalling
         exclude group: 'org.apache.grails', module: 'grails-converters'
     }
-    api "org.apache.grails:grails-url-mappings"
-    api "org.apache.grails:grails-views-gson:$viewsJsonVersion"
-    api 'io.micronaut.rxjava2:micronaut-rxjava2-http-client:1.3.0'
-    api "javax.servlet:javax.servlet-api:$servletApiVersion"
-    api "io.micronaut:micronaut-http-client:$micronautVersion"
-    api "org.apache.grails:grails-converters:3.3.1"
-    api 'com.github.javaparser:javaparser-core:3.25.7'
-    api "com.graphql-java:graphql-java:$graphqlJavaVersion"
-    testImplementation "org.apache.grails:grails-testing-support-web"
-    testImplementation "cglib:cglib-nodep:3.3.0"
-    profile "org.apache.grails.profiles:web-plugin"
+    api project(':grails-url-mappings'), {
+        // api: URL mappings for /graphql endpoint
+    }
+    api project(':grails-converters'), {
+        // api: JSON converters used by the controller
+    }
+    api project(':grails-views-gson'), {
+        // api: GSON view rendering for GraphQL responses
+    }
+    api 'com.github.javaparser:javaparser-core', {
+        // api: parsing of GORM entity sources for schema introspection
+    }
+    api "com.graphql-java:graphql-java:$graphqlJavaVersion", {

Review Comment:
   Acknowledged. The graphql-java and graphql-java-extended-scalars versions 
move into the BOM as part of #15605. Leaving open as a tracker.



##########
grails-data-graphql/plugin/build.gradle:
##########
@@ -17,37 +17,98 @@
  *  under the License.
  */
 
-
 plugins {
-    id "org.apache.grails.gradle.grails-plugin"
-    id "org.apache.grails.gradle.grails-gson"
+    id 'org.apache.grails.buildsrc.properties'
+    id 'org.apache.grails.gradle.grails-plugin'
+    id 'org.apache.grails.gradle.grails-gson'
+    id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.publish'
+    id 'org.apache.grails.buildsrc.sbom'
+    id 'org.apache.grails.gradle.grails-code-style'
+}
+
+version = projectVersion
+group = 'org.apache.grails'
+
+ext {
+    gormApiDocs = true
+    pomTitle = 'GORM for GraphQL'
+    pomDescription = 'Generates a GraphQL schema based on entities in GORM'
 }
 
 dependencies {
-    api "org.apache.grails:grails-controllers"
-    api "org.apache.grails:grails-databinding"
-    api("org.apache.grails:grails-rest-transforms") {
+
+    implementation platform(project(':grails-bom'))
+
+    api project(':grails-data-graphql-core'), {
+        // api: GraphQLEntityNamingConvention, Schema, GraphQLSchema generation
+    }
+    api project(':grails-controllers'), {
+        // api: GraphqlController extends from grails controller infrastructure
+    }
+    api project(':grails-databinding'), {
+        // api: data binding for GraphQL request payloads
+    }
+    api project(':grails-rest-transforms'), {
+        // api: REST transforms used for JSON marshalling
         exclude group: 'org.apache.grails', module: 'grails-converters'
     }
-    api "org.apache.grails:grails-url-mappings"
-    api "org.apache.grails:grails-views-gson:$viewsJsonVersion"
-    api 'io.micronaut.rxjava2:micronaut-rxjava2-http-client:1.3.0'
-    api "javax.servlet:javax.servlet-api:$servletApiVersion"
-    api "io.micronaut:micronaut-http-client:$micronautVersion"
-    api "org.apache.grails:grails-converters:3.3.1"
-    api 'com.github.javaparser:javaparser-core:3.25.7'
-    api "com.graphql-java:graphql-java:$graphqlJavaVersion"
-    testImplementation "org.apache.grails:grails-testing-support-web"
-    testImplementation "cglib:cglib-nodep:3.3.0"
-    profile "org.apache.grails.profiles:web-plugin"
+    api project(':grails-url-mappings'), {
+        // api: URL mappings for /graphql endpoint
+    }
+    api project(':grails-converters'), {
+        // api: JSON converters used by the controller
+    }
+    api project(':grails-views-gson'), {
+        // api: GSON view rendering for GraphQL responses
+    }
+    api 'com.github.javaparser:javaparser-core', {
+        // api: parsing of GORM entity sources for schema introspection
+    }
+    api "com.graphql-java:graphql-java:$graphqlJavaVersion", {
+        // api: GraphQL execution and schema types
+    }
+    api 'jakarta.servlet:jakarta.servlet-api', {
+        // api: HttpServletRequest/Response in GraphqlController
+    }
+    api "io.micronaut:micronaut-http-client:$micronautHttpClientVersion", {
+        // api: HTTP client used by integration tests / playground
+    }
+    api 
"io.micronaut.rxjava2:micronaut-rxjava2-http-client:$micronautRxjava2Version", {
+        // api: RxJava2 variant of micronaut-http-client used by integration 
tests

Review Comment:
   Done in d695a96152. I dropped the explicit micronaut-http-client dep (it's 
pulled in transitively by micronaut-rxjava2-http-client) and demoted the 
rxjava2 client to compileOnly so consumers don't get micronaut on their runtime 
classpath. The trait still compiles; the example apps already declare the 
runtime dep themselves. Resolving.



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