-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
146 additions
and
249 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
19 changes: 4 additions & 15 deletions
19
graphql-client/src/main/java/com/example/demo/Comment.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,8 @@ | ||
package com.example.demo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.eclipse.microprofile.graphql.Id; | ||
import org.eclipse.microprofile.graphql.Type; | ||
public record Comment( | ||
String id, | ||
String content | ||
) { | ||
|
||
@Data | ||
@Builder | ||
@Type | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Comment { | ||
@Id | ||
String id; | ||
String content; | ||
} |
23 changes: 3 additions & 20 deletions
23
graphql-client/src/main/java/com/example/demo/CreatePost.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,8 @@ | ||
package com.example.demo; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.eclipse.microprofile.graphql.Input; | ||
import org.hibernate.validator.constraints.Length; | ||
public record CreatePost( | ||
String title, | ||
String content) { | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Input | ||
public class CreatePost { | ||
|
||
@NotEmpty// bean validation dose not work. | ||
@Length(min = 5) | ||
String title; | ||
|
||
String content; | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,13 @@ | ||
package com.example.demo; | ||
|
||
import lombok.*; | ||
import org.eclipse.microprofile.graphql.Id; | ||
import org.eclipse.microprofile.graphql.Type; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@ToString | ||
@Type | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Post { | ||
@Id | ||
String id; | ||
String title; | ||
String content; | ||
|
||
int countOfComments; | ||
public record Post( | ||
String id, | ||
String title, | ||
String content, | ||
int countOfComments, | ||
List<Comment> comments | ||
) { | ||
|
||
@Builder.Default | ||
List<Comment> comments = new ArrayList<>(); | ||
} |
This file contains 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
This file contains 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
10 changes: 1 addition & 9 deletions
10
graphql-client/src/main/java/com/example/demo/PostSummary.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
package com.example.demo; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ToString | ||
public class PostSummary { | ||
String title; | ||
public record PostSummary(String title) { | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
quarkus.log.level=INFO | ||
com.example.demo.PostGraphQLClient/mp-graphql/url=http://localhost:8080/graphql | ||
post-dynamic-client/mp-graphql/url=http://localhost:8080/graphql | ||
quarkus.log.category."io.smallrye.graphql.client".level=TRACE | ||
quarkus.log.category."io.smallrye.graphql.client".min-level=TRACE | ||
quarkus.log.category."com.example".level=DEBUG | ||
quarkus.smallrye-graphql-client.post-client-typesafe.url=http://localhost:8080/graphql | ||
quarkus.smallrye-graphql-client.post-client-dynamic.url=http://localhost:8080/graphql |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
package com.example.demo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.eclipse.microprofile.graphql.Id; | ||
import org.eclipse.microprofile.graphql.Type; | ||
|
||
@Data | ||
@Builder | ||
@Type | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Comment { | ||
@Id | ||
String id; | ||
String content; | ||
public record Comment( | ||
@Id | ||
String id, | ||
String content | ||
) { | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
package com.example.demo; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.eclipse.microprofile.graphql.Input; | ||
import org.hibernate.validator.constraints.Length; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
import org.hibernate.validator.constraints.Length; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Input | ||
public class CreatePost { | ||
|
||
@NotEmpty// add hibernate-validator extension, else bean validation dose not work. | ||
@Length(min = 5) | ||
String title; | ||
public record CreatePost( | ||
@NotEmpty// add hibernate-validator extension, else bean validation dose not work. | ||
@Length(min = 5) | ||
String title, | ||
String content | ||
) { | ||
|
||
String content; | ||
} |
Oops, something went wrong.