Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Nosto Fork of GraphQL-Java Annotations adds support for partial updates and publishToNostoRepo gradle task for internal use

Adds support for binding to `java.util.Optional` parameters. Binding to Optional parameters allows implementing partial updates. With a partial update the mutate call can update only some of the Optional fields without needing to repeat all the existing values of an object.

The mapping from an optional field in GraphQL schema that binds to `java.util.Optional` is the following:
1. value given to the field in GraphQL call is mapped into `java.util.Optional` of the underlying type
2. null given to the field in GraphQL call is mapped into `Optional.empty` to signal the removal of a possibly existing value of the field
3. field not included in the GraphQL call is mapped into null to signal `undefined` so any possibly existing value(s) should not be modified

## Internal publishing to Nosto repository

Update the version in the `gradle.properties` file and run `./gradlew publishToNostoRepo` to publish the library to the Nosto repository.


![logo](graphql-annotations.png?raw=true)
# GraphQL-Java Annotations
![build](https://github.com/Enigmatis/graphql-java-annotations/actions/workflows/build.yml/badge.svg)
Expand Down
31 changes: 31 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'maven-publish'


// The upstream project build releases seem to be compiled with Java 11 so keeping compatibility so that our changes can be applied to the upstream project
compileJava {
options.release = 11
}
compileTestJava {
options.release = 11
}
Comment on lines +28 to +33
Copy link

Choose a reason for hiding this comment

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

could you add a comment expressing we want to keep it as v11 so the changes we apply can be also applied to the original project?


// custom tasks for creating source/javadoc jars
tasks.register('sourcesJar', Jar) {
dependsOn classes
Expand Down Expand Up @@ -143,7 +151,29 @@ publishing {
}
}
}

repositories {
maven {
url 'https://repo.nos.to/content/repositories/NostoDependencies/'
credentials {
username = project.hasProperty('mavenUser') ? project.mavenUser : ""
password = project.hasProperty('mavenPassword') ? project.mavenPassword : ""
}
}
}
}

tasks.register('publishToNostoRepo') {
dependsOn 'publishMavenPublicationToMavenRepository'
Comment on lines +166 to +167
Copy link

Choose a reason for hiding this comment

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

is this needed?

Copy link
Author

Choose a reason for hiding this comment

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

yes because with the normal publish-task it would try to upload to the sonatype repo that upstream also uses.

}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(':publishToNostoRepo')) {
if (!project.hasProperty('mavenUser') || !project.hasProperty('mavenPassword')) {
throw new GradleException("mavenUser and mavenPassword must be defined for publishToNostoRepo task")
}
}
}


afterReleaseBuild.dependsOn nexusPublishing

Expand All @@ -158,6 +188,7 @@ nexusPublishing {

// to publish to local maven repo skip signing: ./gradlew publishToMavenLocal -x signGraphqlJavaPublication
signing {
required = { !version.endsWith("nosto") }
Copy link

Choose a reason for hiding this comment

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

interesting
I don't see references to this here, but I guess it's read from signing anyways?

Copy link
Author

Choose a reason for hiding this comment

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

It's coming from the signing-plugin and activates when publishing. I disabled it now for our own release version as it requires key setup for signing.

def signingKey = System.getenv("MAVEN_CENTRAL_PGP_KEY")
useInMemoryPgpKeys(signingKey, "")
sign publishing.publications
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8

version = 21.5
version = 21.5-nosto