Skip to content

Conversation

@rwilliams-r7
Copy link
Contributor

Upgrading graphql-java to version 8.0.

Note junit had to be changed EndToEndSpec.groovy. Not 100% sure if this is correct, please review.

val scalars = scalarDefinitions.filter { !ScalarInfo.STANDARD_SCALAR_DEFINITIONS.containsKey(it.name) }.map { definition ->
val provided = scalars[definition.name] ?: throw SchemaClassScannerError("Expected a user-defined GraphQL scalar type with name '${definition.name}' but found none!")
GraphQLScalarType(provided.name, SchemaParser.getDocumentation(definition) ?: provided.description, provided.coercing, definition)
GraphQLScalarType(provided.name, SchemaParser.getDocumentation(definition) ?: provided.description, provided.coercing, ArrayList<GraphQLDirective>(), definition)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an emptyList. The new builder part of GraphQLScalarType did not allow Coercing coercing to be set. Have used the only constructor that allows me to pass the args required. With this in mind I have had to pass an empty list ArrayList<GraphQLDirective>(), as it cannot be null.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you mind changing this to listOf()?


then:
returnedItem.id == 1
returnedItem.get("onItemCreated").id == 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not 100% sure if this is correct.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What prompted the change?

Copy link
Contributor Author

@rwilliams-r7 rwilliams-r7 Apr 4, 2018

Choose a reason for hiding this comment

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

returnedItem.id was null and of course the junit failed as it returns a map. I am not sure if it is due to a change I have made, that is now returns a map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apottere - are you happy enough with this?

Choose a reason for hiding this comment

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

I dug into this - it looks like the reason the behavior change was due to this change in graphql-java:

graphql-java/graphql-java@adcd3f7#diff-83f68d2746cff37c74d371d07db0e53b

"This commit adds the root field to subscription results to conform to
the current version of the GraphQL specification."

So it's an expected change to be spec compliant.

@rwilliams-r7 rwilliams-r7 force-pushed the update-to-graphql-java-8 branch from 2aba06e to 26256b8 Compare April 4, 2018 22:09
@rwilliams-r7
Copy link
Contributor Author

Can this be merged?

@maarek
Copy link

maarek commented Apr 11, 2018

Any update on this?

@esovan
Copy link

esovan commented Apr 23, 2018

Update? 😀

@esovan
Copy link

esovan commented Apr 25, 2018

Is there any way i can use this before it is merged to master? We really need it for our project. 😁

@filipncs
Copy link
Contributor

@esovan If you already have an internal maven repository, you can simply fork the project and push the maven artifact to your repository. You can then use this artifact just like you used the official artifacts.

If none of that sounds familiar, you can get away with just building the library locally and including the jar in your project. But it's probably a good investment to figure out how to do your own library builds properly.

@esovan
Copy link

esovan commented Apr 25, 2018

@filipncs Yes, i was planning on doing so if no other solution was suggested 😁 thanks though 😃

@apottere apottere merged commit 9e8ca2e into graphql-java-kickstart:master Apr 25, 2018
@apottere
Copy link
Collaborator

Sorry for the delay on this, it's syncing to central as 5.0.0 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants