From 95ef03c220cf66fbf8bf8ace527e8abff9530cd1 Mon Sep 17 00:00:00 2001 From: Serge Huber Date: Thu, 2 May 2024 11:31:04 +0200 Subject: [PATCH 1/4] Add release documentation & update version (#303) --- RELEASE.md | 18 ++++++++++++++++++ gradle.properties | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..50885ed3 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,18 @@ +RELEASE DOCUMENTATION +--------------------- + +Here are the steps to produce a release of the project: + +1. Check the gradle.properties file to make sure that the version number has been updated +2. In the Github release UI, create a new tag with the following naming convention vXX.X and make sure you generate the release notes. +3. Create the release using the create release button +4. Wait for the build action to complete successfully +5. Launch the "Publish" action manually and wait for it to complete +6. Check at the following URL that the new release was deployed : + + https://repo1.maven.org/maven2/io/github/graphql-java/graphql-java-annotations/ + + It might take some time for the release to appear +7. Update this document if anything was missing or wasn't clear +8. Once everything is properly deployed, update the gradle.properties file to the next planned version, either directly (if that is the only change), or in a PR if other changes need to be done at the same time. +9. Announce the release on your favorite communication channels. diff --git a/gradle.properties b/gradle.properties index f4b4b977..1648a9b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ org.gradle.daemon=true org.gradle.parallel=true org.gradle.jvmargs=-Dfile.encoding=UTF-8 -version = 21.2 +version = 21.5 \ No newline at end of file From 2e0f87a7392e825f59d0162bd870699dd191c99b Mon Sep 17 00:00:00 2001 From: geichelberger <35195803+geichelberger@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:15:18 +0200 Subject: [PATCH 2/4] Use actual graphql name on extending type (#301) * Use actual graphql name on extending type If a type is extended via a GraphQLTypeExtension annotation, the simple class name is used instead of checking whether a GraphQLName annotation is available; if the GraphQL name differs from the class name, the field cannot be fetched. * Add different graphql name extension test case --- .../retrievers/GraphQLExtensionsHandler.java | 5 +- .../annotations/GraphQLExtensionsTest.java | 57 +++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/main/java/graphql/annotations/processor/retrievers/GraphQLExtensionsHandler.java b/src/main/java/graphql/annotations/processor/retrievers/GraphQLExtensionsHandler.java index 19363971..a2f49c65 100644 --- a/src/main/java/graphql/annotations/processor/retrievers/GraphQLExtensionsHandler.java +++ b/src/main/java/graphql/annotations/processor/retrievers/GraphQLExtensionsHandler.java @@ -44,6 +44,7 @@ public class GraphQLExtensionsHandler { public List getExtensionFields(Class object, List definedFields, ProcessingElementsContainer container) throws CannotCastMemberException { List fields = new ArrayList<>(); + String typeName = graphQLObjectInfoRetriever.getTypeName(object); if (container.getExtensionsTypeRegistry().containsKey(object)) { for (Class aClass : container.getExtensionsTypeRegistry().get(object)) { for (Method method : graphQLObjectInfoRetriever.getOrderedMethods(aClass)) { @@ -51,7 +52,7 @@ public List getExtensionFields(Class object, List getExtensionFields(Class object, List fields = object.getFieldDefinitions(); + assertEquals(fields.size(), 2); + + fields = ImmutableList.sortedCopyOf(Comparator.comparing(GraphQLFieldDefinition::getName), fields); + + assertEquals(fields.get(0).getName(), "field"); + assertEquals(fields.get(1).getName(), "field2"); + assertEquals(fields.get(0).getType(), GraphQLString); + assertEquals(fields.get(1).getType(), GraphQLString); + } + @Test public void values() { GraphQLSchema schema = newAnnotationsSchema().query(TestObject.class).typeExtension(TestObjectExtension.class).build(); @@ -127,6 +170,19 @@ public void values() { assertEquals(data.get("field5"), "test test5"); } + @Test + public void valuesDifferentGraphQLName() { + GraphQLSchema schema = newAnnotationsSchema().query(DifferentNameTestObject.class).typeExtension(DifferentNameTestObjectExtension.class).build(); + + assertTrue(schema.getCodeRegistry().hasDataFetcher(FieldCoordinates.coordinates("DifferentObject", "field2"))); + + ExecutionResult result = GraphQL.newGraphQL( schema ).build().execute( + GraphQLHelper.createExecutionInput( "{field field2}", new GraphQLExtensionsTest.DifferentNameTestObject() ) ); + Map data = result.getData(); + assertEquals(data.get("field"), "different"); + assertEquals(data.get("field2"), "different field2"); + } + @Test public void testDuplicateField() { GraphQLAnnotations instance = new GraphQLAnnotations(); @@ -135,4 +191,5 @@ public void testDuplicateField() { GraphQLAnnotationsException e = expectThrows(GraphQLAnnotationsException.class, () -> graphQLObjectHandler.getGraphQLType(TestObject.class, instance.getContainer())); assertTrue(e.getMessage().startsWith("Duplicate field")); } + } From 5acf12018f4bb9b8b0a6829651449960fb892b60 Mon Sep 17 00:00:00 2001 From: Janin Michel-Mathias <107043504+Janin-Michel-Mathias@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:32:39 +0200 Subject: [PATCH 3/4] upgrade graphql-java version to 21.5 (#304) --- README.md | 4 ++-- build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 22387ff5..3d1463dc 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ If you would like to use a tool that creates a graphql spring boot server using ```groovy dependencies { - compile "io.github.graphql-java:graphql-java-annotations:21.2" + compile "io.github.graphql-java:graphql-java-annotations:21.5" } ``` @@ -47,7 +47,7 @@ dependencies { io.github.graphql-java graphql-java-annotations - 21.2 + 21.5 ``` diff --git a/build.gradle b/build.gradle index 719f403e..7ebc5127 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ gradle.projectsEvaluated { dependencies { implementation 'javax.validation:validation-api:1.1.0.Final' - implementation 'com.graphql-java:graphql-java:21.2' + implementation 'com.graphql-java:graphql-java:21.5' implementation 'com.graphql-java:graphql-java-extended-scalars:21.0' implementation 'javax.xml.bind:jaxb-api:2.3.1' From a810d76f0e3a978ef92650b052766e1a59cee67a Mon Sep 17 00:00:00 2001 From: "Francois G." Date: Tue, 30 Jul 2024 14:31:17 +0200 Subject: [PATCH 4/4] Updated secrets for publishing to maven central (#306) --- .github/workflows/publish.yml | 4 ++-- build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2cdc7632..c9d6ba24 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,6 @@ jobs: - name: Publish with Gradle run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository env: - MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }} - MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USERTOKEN_USERNAME }} + MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_USERTOKEN_PASSWORD }} MAVEN_CENTRAL_PGP_KEY: ${{ secrets.MAVEN_CENTRAL_PGP_KEY }} diff --git a/build.gradle b/build.gradle index 7ebc5127..cc8d0e72 100644 --- a/build.gradle +++ b/build.gradle @@ -150,8 +150,8 @@ afterReleaseBuild.dependsOn nexusPublishing nexusPublishing { repositories { sonatype { - username = System.getenv("MAVEN_CENTRAL_USER") - password = System.getenv("MAVEN_CENTRAL_PASSWORD") + username = System.getenv("MAVEN_CENTRAL_USERTOKEN_USERNAME") + password = System.getenv("MAVEN_CENTRAL_USERTOKEN_PASSWORD") } } }