Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
deda503
feat(grails-data-graphql): migrate to Grails 7.1.0
kirpi4ik Apr 20, 2026
2c1bf5f
Drop migration summary
kirpi4ik Apr 20, 2026
64f1ad0
Add the Apache License 2.0 header to several GraphQL type builder cla…
kirpi4ik Apr 21, 2026
ec6343f
Cleanup and update gradle.properties for grails-data-graphql: streaml…
kirpi4ik Apr 21, 2026
0d0f834
update properties back with projectDescription and projectUrl
kirpi4ik Apr 21, 2026
6b0fe6a
feat(grails-data-graphql): integrate into the main Grails monorepo build
jamesfredley Apr 26, 2026
9d7d494
feat(grails-test-examples): integrate grails-data-graphql example apps
jamesfredley Apr 26, 2026
f1b80ea
Update RENAME.md & helper script for package renames
jdaugherty Apr 26, 2026
ef154b7
feat(grails-forge): add gorm-graphql feature to the application gener…
jamesfredley Apr 26, 2026
d695a96
refactor(grails-data-graphql): address review feedback
jamesfredley Apr 26, 2026
3d52497
Merge branch '7.2.x' of https://github.com/apache/grails-core into mi…
kirpi4ik Apr 29, 2026
487c345
Merge remote-tracking branch 'origin/7.2.x' into pr-15587-work
jdaugherty Apr 29, 2026
8640438
Merge branch 'migrate-grails-data-graphql-to-grails-7.1.x' of https:/…
kirpi4ik Apr 29, 2026
13e3346
Merge remote-tracking branch 'origin/7.2.x' into pr-15587-merge
jamesfredley Apr 29, 2026
c2a8349
Merge branch '7.2.x' into migrate-grails-data-graphql-to-grails-7.1.x
kirpi4ik Apr 30, 2026
ad55a19
Merge branch '7.2.x' into migrate-grails-data-graphql-to-grails-7.1.x
jamesfredley Apr 30, 2026
f7e9918
refactor(grails-data-graphql): move graphql-java and graphql-java-ex…
kirpi4ik May 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RENAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Below is a reference of all migrated artifacts - both their old and new name.
| org.grails | grails-plugin-controllers | org.apache.grails | grails-controllers | | | grails-core |
| org.grails.plugins | converters | org.apache.grails | grails-converters | | | grails-core |
| org.grails | grails-core | org.apache.grails | grails-core | | | grails-core |
| org.grails | gorm-graphql | org.apache.grails.data | grails-data-graphql-core | | | grails-data-mapping |
| org.grails | gorm-graphql-plugin | org.apache.grails | grails-data-graphql | | | grails-data-mapping |
| org.grails.plugins | hibernate5 | org.apache.grails | grails-data-hibernate5 | | | grails-data-mapping |
| org.grails.plugins | database-migration | org.apache.grails | grails-data-hibernate5-dbmigration | | | grails-data-mapping |
| org.grails | gorm-hibernate5-spring-boot | org.apache.grails | grails-data-hibernate5-spring-boot | | | grails-data-mapping |
Expand Down
4 changes: 4 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ ext {
'commons-codec.version' : '1.18.0',
'commons-lang3.version' : '3.20.0',
'geb-spock.version' : '8.0.1',
'graphql-java.version' : '24.3',
'graphql-java-extended-scalars.version': '24.0',
'groovy.version' : '4.0.31',
'jackson.version' : '2.21.2',
'jquery.version' : '3.7.1',
Expand Down Expand Up @@ -109,6 +111,8 @@ ext {
'commons-codec' : "commons-codec:commons-codec:${bomDependencyVersions['commons-codec.version']}",
'commons-lang3' : "org.apache.commons:commons-lang3:${bomDependencyVersions['commons-lang3.version']}",
'geb-spock' : "org.apache.groovy.geb:geb-spock:${bomDependencyVersions['geb-spock.version']}",
'graphql-java' : "com.graphql-java:graphql-java:${bomDependencyVersions['graphql-java.version']}",
'graphql-java-extended-scalars': "com.graphql-java:graphql-java-extended-scalars:${bomDependencyVersions['graphql-java-extended-scalars.version']}",
// start - restate the groovy-bom includes here because the spring dependency management will pick the library from spring-boot-dependencies otherwise
'groovy' : "org.apache.groovy:groovy:${bomDependencyVersions['groovy.version']}",
'groovy-ant' : "org.apache.groovy:groovy-ant:${bomDependencyVersions['groovy.version']}",
Expand Down
2 changes: 2 additions & 0 deletions etc/bin/rename_gradle_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ declare -a gorm_mappings=(
"org[.]grails:grails-datastore-gorm-mongodb|org.apache.grails.data:grails-data-mongodb-core"
"org[.]grails:grails-datastore-gorm-hibernate6|org.apache.grails.data:grails-data-hibernate6-core"
"org[.]grails:grails-datastore-gorm-hibernate5|org.apache.grails.data:grails-data-hibernate5-core"
"org[.]grails:gorm-graphql|org.apache.grails.data:grails-data-graphql-core"
"org[.]grails:gorm-graphql-plugin|org.apache.grails:grails-data-graphql"
"org[.]grails:grails-datastore-gorm-async|org.apache.grails.data:grails-datamapping-async"
"org[.]grails:grails-datastore-gorm|org.apache.grails.data:grails-datamapping-core"
"org[.]grails:grails-datastore-gorm-tck|org.apache.grails.data:grails-datamapping-tck-tests"
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ gradleCycloneDxPluginVersion=2.4.1
# micronaut libraries not in the bom due to the potential for spring mismatches
# Note: we cannot update to 4.10.x due to netty 4.2 being used (incompatible with spring boot 3.5.x)
micronautPlatformVersion=4.9.4
micronautRxjava2Version=2.9.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the bom

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer as above - waiting on the BOM restructure (#15605). Leaving open as a tracker so we don't lose the cleanup.


# Libraries only specific to test apps, these should not be exposed
ersatzVersion=4.0.1
Expand Down
3 changes: 3 additions & 0 deletions gradle/publish-root-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def publishedProjects = [
'grails-data-mongodb-ext',
'grails-data-mongodb-gson-templates',
'grails-data-mongodb-spring-boot',
// graphql
'grails-data-graphql',
'grails-data-graphql-core',
// wrapper
'grails-wrapper',
// profiles
Expand Down
35 changes: 29 additions & 6 deletions grails-data-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,38 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Gorm GraphQL
# GORM for GraphQL

This project has not been updated for Grails 7 yet and is not included in the build.
This project generates a GraphQL schema based on entities mapped with [GORM](https://grails.apache.org/docs/latest/grails-data/).

## An automatic GraphQL schema generator for GORM
For more information see the following links:

Current documentation https://grails.github.io/grails-data-graphql/3.0.x/hibernate/guide/index.html
* [Documentation](https://grails.apache.org/docs/latest/grails-data/graphql/manual/)
* [API](https://grails.apache.org/docs/latest/api)

For the current development version see the following links:

### Dependencies
* [Snapshot Documentation](https://grails.apache.org/docs/snapshot/grails-data/graphql/manual/)
* [Snapshot API](https://grails.apache.org/docs/snapshot/api)

- [Graphql Java](https://github.com/graphql-java/graphql-java)
## Modules

The plugin is split across the following modules in the root `settings.gradle`:

| Module | Gradle path | Maven coordinates |
| --------------- | ---------------------------- | ------------------------------------------------- |
| Core schema lib | `:grails-data-graphql-core` | `org.apache.grails.data:grails-data-graphql-core` |
| Grails plugin | `:grails-data-graphql` | `org.apache.grails:grails-data-graphql` |
| Reference guide | `:grails-data-graphql-docs` | (not published) |
Comment thread
jamesfredley marked this conversation as resolved.

## Example applications

Five demo applications live under `grails-test-examples/graphql/`:

| Project gradle path | Description |
| -------------------------------------------------------------- | -------------------------------------------------------- |
| `:grails-test-examples-graphql-grails-test-app` | End-to-end Grails REST app exercising every type/feature |
| `:grails-test-examples-graphql-grails-docs-app` | Grails REST app backing the reference-guide examples |
| `:grails-test-examples-graphql-grails-tenant-app` | Grails app demonstrating GORM multi-tenancy |
| `:grails-test-examples-graphql-grails-multi-datastore-app` | Grails app combining Hibernate5 + MongoDB datastores |
| `:grails-test-examples-graphql-spring-boot-app` | Standalone Spring Boot app embedding the schema generator core |
101 changes: 0 additions & 101 deletions grails-data-graphql/build.gradle

This file was deleted.

78 changes: 43 additions & 35 deletions grails-data-graphql/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,55 @@
* under the License.
*/

repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/restricted" }
plugins {
id 'groovy'
id 'java-library'
id 'org.apache.grails.buildsrc.properties'
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'
}
apply plugin: 'codenarc'

dependencies {
documentation "org.codehaus.groovy:groovy-cli-picocli"

api "org.apache.grails.data:grails-datamapping-core:${gormVersion}"
api "com.graphql-java:graphql-java:$graphqlJavaVersion"
api "com.graphql-java:graphql-java-extended-scalars:$graphqlJavaScalarExtVersion"
api 'com.github.javaparser:javaparser-core:3.25.7'
api 'org.apache.grails:grails-views-gson:2.3.2'
api "org.javassist:javassist:$javassistVersion"

codenarc "org.codenarc:CodeNarc:$codenarcVersion"

testImplementation "org.apache.grails.data:grails-data-hibernate5-core:${gormHibernateVersion}"
testImplementation "org.apache.grails.data:grails-data-mongodb-core:${gormMongoDbVersion}"
testImplementation 'com.github.fakemongo:fongo:2.1.1'
testImplementation 'com.h2database:h2:2.2.224'
testImplementation 'org.apache.tomcat:tomcat-jdbc:8.5.97'
testImplementation "org.slf4j:slf4j-api:$slf4jVersion"
version = projectVersion
group = 'org.apache.grails.data'

ext {
gormApiDocs = true
pomTitle = 'GORM for GraphQL'
pomDescription = 'Generates a GraphQL schema based on entities in GORM'
}

targetCompatibility = 1.8
sourceCompatibility = 1.8
dependencies {

codenarc {
toolVersion = codenarcVersion
configFile = file("${projectDir}/config/codenarc/rules.groovy")
maxPriority1Violations = 0
maxPriority2Violations = 0
maxPriority3Violations = 0
}
implementation platform(project(':grails-bom'))

api project(':grails-datamapping-core'), {
// api: ConstrainedProperty, GormEntity, MappingContext, PersistentEntity, PersistentProperty
}
api 'com.graphql-java:graphql-java', {
// api: GraphQLSchema, GraphQLType, GraphQLObjectType, DataFetcher, DataFetchingEnvironment
}
api 'com.graphql-java:graphql-java-extended-scalars', {
// api: ExtendedScalars
}
api 'com.github.javaparser:javaparser-core', {
// api: JavaParser, ParseResult, CompilationUnit
}
api "org.javassist:javassist:$javassistVersion", {
// api: ClassPool, CtClass, CtMethod (used for runtime bytecode manipulation)
}

codenarcMain {
exclude '**/CustomScalars.groovy'
testImplementation project(':grails-data-hibernate5-core')
testImplementation 'com.h2database:h2'
testImplementation 'org.apache.tomcat:tomcat-jdbc'
testImplementation 'org.slf4j:slf4j-api'
testImplementation 'org.objenesis:objenesis'
testImplementation 'net.bytebuddy:byte-buddy'
testImplementation 'org.spockframework:spock-core'
}

codenarcTest {
ignoreFailures = true
apply {
from rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle')
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@

package org.grails.gorm.graphql

import graphql.schema.*
import graphql.schema.DataFetcher
import graphql.schema.GraphQLCodeRegistry
import graphql.schema.GraphQLFieldDefinition
import graphql.schema.GraphQLInputType
import graphql.schema.GraphQLObjectType
import graphql.schema.GraphQLOutputType
import graphql.schema.GraphQLSchema
import graphql.schema.GraphQLType
import groovy.transform.CompileStatic
import javassist.Modifier
import org.grails.datastore.mapping.model.MappingContext
Expand Down Expand Up @@ -66,9 +73,15 @@ import org.grails.gorm.graphql.types.DefaultGraphQLTypeManager
import org.grails.gorm.graphql.types.GraphQLPropertyType
import org.grails.gorm.graphql.types.GraphQLTypeManager
import org.grails.gorm.graphql.types.scalars.coercing.DateCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.*
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.InstantCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.LocalDateCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.LocalDateTimeCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.LocalTimeCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.OffsetDateTimeCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.OffsetTimeCoercion
import org.grails.gorm.graphql.types.scalars.coercing.jsr310.ZonedDateTimeCoercion
import org.springframework.context.support.StaticMessageSource
import javax.annotation.PostConstruct
import jakarta.annotation.PostConstruct
import java.time.Instant
import java.time.LocalDate
import java.time.LocalDateTime
Expand All @@ -83,7 +96,12 @@ import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition
import static graphql.schema.GraphQLList.list
import static graphql.schema.GraphQLObjectType.newObject
import static graphql.schema.GraphQLScalarType.newScalar
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.*
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.COUNT
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.CREATE
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.DELETE
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.GET
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.LIST
import static org.grails.gorm.graphql.fetcher.GraphQLDataFetcherType.UPDATE

/**
* Created by jameskleeh on 5/19/17.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,26 @@
*/
package org.grails.gorm.graphql.entity;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import graphql.execution.MergedField;
import graphql.language.Field;
import graphql.language.Selection;
import graphql.language.SelectionSet;
import graphql.schema.DataFetchingEnvironment;

import org.grails.datastore.gorm.GormEnhancer;
import org.grails.datastore.mapping.model.PersistentEntity;
import org.grails.datastore.mapping.model.types.Association;
import org.grails.datastore.mapping.model.types.ToMany;
import org.grails.datastore.mapping.model.types.ToOne;

import java.util.*;
import java.util.stream.Collectors;

/**
* Helper class to determine which properties should be eagerly
* fetched based on the fields in a {@link DataFetchingEnvironment}.
Expand Down Expand Up @@ -158,7 +164,6 @@ else if (selections.size() == 1 && selections.get(0) instanceof Field) {
joinProperties.addAll(new EntityFetchOptions(entity, resolvedName).getJoinProperties(fields));
}


public Set<String> getJoinProperties(List<Field> fields) {
return getJoinProperties(fields, false);
}
Expand Down Expand Up @@ -241,7 +246,6 @@ public Map<String, Map> getFetchArgument(Set<String> properties) {
return arguments;
}


public Map<String, Map> getFetchArgument(DataFetchingEnvironment environment) {
return getFetchArgument(environment, false);
}
Expand Down
Loading