Java Projection Classes express an explicit Schema Type#184
Merged
Conversation
The Java Projection classes will now reflect an explicit GraphQL Schema Type via their optional `getSchemaType` method. This is used to help the DGS GraphQL Client resolve the Schema Type required to express the projection in the GraphQL Query.
berngp
commented
Jun 30, 2021
| val iMovie = interfaces[0] | ||
| assertThat(iMovie.typeSpec.name).isEqualTo("IMovie") | ||
| assertThat(iMovie.typeSpec.methodSpecs).extracting("name").containsExactly("getId", "getTitle", "getGenre", "getLanguage", "getTags", "getRating") | ||
| assertThat(iMovie.typeSpec.methodSpecs[0].returnType).extracting("simpleName").containsExactly("String") |
Contributor
Author
There was a problem hiding this comment.
Had to change from containsExactly to isEqualTo due that the API is not available anymore after the dependencies were updated.
berngp
commented
Jun 30, 2021
| import java.util.* | ||
| import javax.tools.JavaFileObject | ||
|
|
||
| internal class CodegenTestClassLoader(private val compilation: Compilation, parent: ClassLoader?) : ClassLoader(parent) { |
Contributor
Author
There was a problem hiding this comment.
This test Classloader can be used when interacting with any of the classes available in the given compilation. Even if the class depend on others defined in codegen. This is not the case with the compileAndGetClass method in ClientApiGenTest.
Contributor
There was a problem hiding this comment.
Very cool, you got the classloader test set up!
srinivasankavitha
approved these changes
Jun 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Java Projection classes will now reflect an explicit GraphQL Schema
Type via their optional
getSchemaTypemethod. This is used to helpthe DGS GraphQL Client resolve the Schema Type required to express the
projection in the GraphQL Query.