Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client api v2 #340

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/dgs-federation-example.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions reviews-dgs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id("io.spring.dependency-management") version "1.0.12.RELEASE"
kotlin("plugin.spring") version "1.6.21"
id("java")
id("com.netflix.dgs.codegen") version "5.5.0"
id("com.netflix.dgs.codegen") version "5.11.1"
}

group = "com.example"
Expand All @@ -40,7 +40,7 @@ dependencies {
}

tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
generateClient = true
generateClientv2 = true
packageName = "com.example.demo.generated"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void shows() {
@Test
void showsWithEntitiesQueryBuilder() {
EntitiesGraphQLQuery entitiesQuery = new EntitiesGraphQLQuery.Builder().addRepresentationAsVariable(ShowRepresentation.newBuilder().id("1").build()).build();
GraphQLQueryRequest request = new GraphQLQueryRequest(entitiesQuery, new EntitiesProjectionRoot().onShow().reviews().starRating());
GraphQLQueryRequest request = new GraphQLQueryRequest(entitiesQuery, new EntitiesProjectionRoot<>().onShow().reviews().starRating());
List<Review> reviewsList = dgsQueryExecutor.executeAndExtractJsonPathAsObject(
request.serialize(),
"data['_entities'][0].reviews", entitiesQuery.getVariables(), new TypeRef<>() {
Expand Down
4 changes: 2 additions & 2 deletions shows-dgs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id("io.spring.dependency-management") version "1.0.12.RELEASE"
kotlin("jvm") version "1.7.10"
kotlin("plugin.spring") version "1.6.21"
id("com.netflix.dgs.codegen") version "5.5.0"
id("com.netflix.dgs.codegen") version "5.11.1"
}

group = "com.example"
Expand All @@ -42,7 +42,7 @@ dependencies {

@OptIn(kotlin.ExperimentalStdlibApi::class)
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
generateClient = true
generateClientv2 = true
packageName = "com.example.demo.generated"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ShowsDataFetcherTest {
GraphQLQueryRequest(
ShowsGraphQLQuery.Builder()
.build(),
ShowsProjectionRoot().title())
ShowsProjectionRoot<>().title())
val titles = dgsQueryExecutor.executeAndExtractJsonPath<List<String>>(graphQLQueryRequest.serialize(), "data.shows[*].title")
assertThat(titles).contains("mock title")
}
Expand Down