Skip to content

Commit fd8ed4b

Browse files
committed
Reduce complexity of the query
1 parent a79a36c commit fd8ed4b

File tree

5 files changed

+14
-160
lines changed

5 files changed

+14
-160
lines changed

quarkus-graphql-client/src/main/java/gitlab/GreetingResource.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ public String hello() {
2828
@Path("/hardcoded")
2929
@Produces(MediaType.TEXT_PLAIN)
3030
public String read() {
31-
String p = "tech-marketing/demos/gitlab-agile-demo/initech";
31+
String p = "stage/main/product-management";
3232
List<String> r = List.of(
33-
"tech-marketing/demos/gitlab-agile-demo/initech/music-store&2",
34-
"tech-marketing/demos/gitlab-agile-demo/initech&2",
35-
"tech-marketing/demos/gitlab-agile-demo/initech&5",
36-
"tech-marketing/demos/gitlab-agile-demo/initech/music-store/parent-portal#2");
33+
"&1");
3734
WorkItemConnection response = api.workItemsByReference(p, r);
3835
return response.toString();
3936
}

quarkus-graphql-client/src/main/java/gitlab/model/AwardEmoji.java

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
@Name("AwardEmoji")
1111
public class AwardEmoji {
1212

13-
/**
14-
* Emoji description.
15-
*/
16-
private String description;
17-
/**
18-
* Emoji as an icon.
19-
*/
20-
private String emoji;
2113
/**
2214
* Emoji name.
2315
*/
@@ -30,28 +22,6 @@ public class AwardEmoji {
3022
* Unicode version for the emoji.
3123
*/
3224
private String unicodeVersion;
33-
/**
34-
* User who awarded the emoji.
35-
*/
36-
private UserCore user;
37-
38-
public String getDescription() {
39-
return description;
40-
}
41-
42-
public AwardEmoji setDescription(String description) {
43-
this.description = description;
44-
return this;
45-
}
46-
47-
public String getEmoji() {
48-
return emoji;
49-
}
50-
51-
public AwardEmoji setEmoji(String emoji) {
52-
this.emoji = emoji;
53-
return this;
54-
}
5525

5626
public String getName() {
5727
return name;
@@ -80,18 +50,9 @@ public AwardEmoji setUnicodeVersion(String unicodeVersion) {
8050
return this;
8151
}
8252

83-
public UserCore getUser() {
84-
return user;
85-
}
86-
87-
public AwardEmoji setUser(UserCore user) {
88-
this.user = user;
89-
return this;
90-
}
91-
9253
@Override
9354
public int hashCode() {
94-
return Objects.hash(description, emoji, name, unicode, unicodeVersion, user);
55+
return Objects.hash(name, unicode, unicodeVersion);
9556
}
9657

9758
@Override
@@ -103,12 +64,12 @@ public boolean equals(Object obj) {
10364
if (getClass() != obj.getClass())
10465
return false;
10566
AwardEmoji other = (AwardEmoji) obj;
106-
return Objects.equals(description, other.description) && Objects.equals(emoji, other.emoji) && Objects.equals(name, other.name) && Objects.equals(unicode, other.unicode) && Objects.equals(unicodeVersion, other.unicodeVersion) && Objects.equals(user, other.user);
67+
return Objects.equals(name, other.name) && Objects.equals(unicode, other.unicode) && Objects.equals(unicodeVersion, other.unicodeVersion);
10768
}
10869

10970
@Override
11071
public String toString() {
111-
return "AwardEmoji [description=" + description + ", emoji=" + emoji + ", name=" + name + ", unicode=" + unicode + ", unicodeVersion=" + unicodeVersion + ", user=" + user + "]";
72+
return "AwardEmoji [name=" + name + ", unicode=" + unicode + ", unicodeVersion=" + unicodeVersion + "]";
11273
}
11374

11475
}

quarkus-graphql-client/src/main/java/gitlab/model/Discussion.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
@Name("Discussion")
88
public class Discussion {
99

10-
/**
11-
* Timestamp of the discussion's creation.
12-
*/
13-
private Time createdAt;
1410
/**
1511
* ID of the discussion.
1612
*/
@@ -20,15 +16,6 @@ public class Discussion {
2016
*/
2117
private NoteConnection notes;
2218

23-
public Time getCreatedAt() {
24-
return createdAt;
25-
}
26-
27-
public Discussion setCreatedAt(Time createdAt) {
28-
this.createdAt = createdAt;
29-
return this;
30-
}
31-
3219
public DiscussionID getId() {
3320
return id;
3421
}
@@ -49,7 +36,7 @@ public Discussion setNotes(NoteConnection notes) {
4936

5037
@Override
5138
public int hashCode() {
52-
return Objects.hash(createdAt, id, notes);
39+
return Objects.hash(id, notes);
5340
}
5441

5542
@Override
@@ -61,12 +48,12 @@ public boolean equals(Object obj) {
6148
if (getClass() != obj.getClass())
6249
return false;
6350
Discussion other = (Discussion) obj;
64-
return Objects.equals(createdAt, other.createdAt) && Objects.equals(id, other.id) && Objects.equals(notes, other.notes);
51+
return Objects.equals(id, other.id) && Objects.equals(notes, other.notes);
6552
}
6653

6754
@Override
6855
public String toString() {
69-
return "Discussion [createdAt=" + createdAt + ", id=" + id + ", notes=" + notes + "]";
56+
return "Discussion [id=" + id + ", notes=" + notes + "]";
7057
}
7158

7259
}

quarkus-graphql-client/src/main/java/gitlab/model/Note.java

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,10 @@ public class Note {
1919
* Content of the note.
2020
*/
2121
private String body;
22-
/**
23-
* Timestamp of the note creation.
24-
*/
25-
private Time createdAt;
2622
/**
2723
* ID of the note.
2824
*/
2925
private NoteID id;
30-
/**
31-
* Timestamp when note was last edited.
32-
*/
33-
private Time lastEditedAt;
34-
/**
35-
* Indicates whether the note was created by the system or by a user.
36-
*/
37-
private Boolean system;
38-
/**
39-
* Name of the icon corresponding to a system note.
40-
*/
41-
private String systemNoteIconName;
42-
/**
43-
* Timestamp of the note's last activity.
44-
*/
45-
private Time updatedAt;
46-
/**
47-
* URL to view the note in the Web UI.
48-
*/
49-
private String url;
5026

5127
public UserCore getAuthor() {
5228
return author;
@@ -75,15 +51,6 @@ public Note setBody(String body) {
7551
return this;
7652
}
7753

78-
public Time getCreatedAt() {
79-
return createdAt;
80-
}
81-
82-
public Note setCreatedAt(Time createdAt) {
83-
this.createdAt = createdAt;
84-
return this;
85-
}
86-
8754
public NoteID getId() {
8855
return id;
8956
}
@@ -93,54 +60,9 @@ public Note setId(NoteID id) {
9360
return this;
9461
}
9562

96-
public Time getLastEditedAt() {
97-
return lastEditedAt;
98-
}
99-
100-
public Note setLastEditedAt(Time lastEditedAt) {
101-
this.lastEditedAt = lastEditedAt;
102-
return this;
103-
}
104-
105-
public Boolean getSystem() {
106-
return system;
107-
}
108-
109-
public Note setSystem(Boolean system) {
110-
this.system = system;
111-
return this;
112-
}
113-
114-
public String getSystemNoteIconName() {
115-
return systemNoteIconName;
116-
}
117-
118-
public Note setSystemNoteIconName(String systemNoteIconName) {
119-
this.systemNoteIconName = systemNoteIconName;
120-
return this;
121-
}
122-
123-
public Time getUpdatedAt() {
124-
return updatedAt;
125-
}
126-
127-
public Note setUpdatedAt(Time updatedAt) {
128-
this.updatedAt = updatedAt;
129-
return this;
130-
}
131-
132-
public String getUrl() {
133-
return url;
134-
}
135-
136-
public Note setUrl(String url) {
137-
this.url = url;
138-
return this;
139-
}
140-
14163
@Override
14264
public int hashCode() {
143-
return Objects.hash(author, awardEmoji, body, createdAt, id, lastEditedAt, system, systemNoteIconName, updatedAt, url);
65+
return Objects.hash(author, awardEmoji, body, id);
14466
}
14567

14668
@Override
@@ -152,12 +74,12 @@ public boolean equals(Object obj) {
15274
if (getClass() != obj.getClass())
15375
return false;
15476
Note other = (Note) obj;
155-
return Objects.equals(author, other.author) && Objects.equals(awardEmoji, other.awardEmoji) && Objects.equals(body, other.body) && Objects.equals(createdAt, other.createdAt) && Objects.equals(id, other.id) && Objects.equals(lastEditedAt, other.lastEditedAt) && Objects.equals(system, other.system) && Objects.equals(systemNoteIconName, other.systemNoteIconName) && Objects.equals(updatedAt, other.updatedAt) && Objects.equals(url, other.url);
77+
return Objects.equals(author, other.author) && Objects.equals(awardEmoji, other.awardEmoji) && Objects.equals(body, other.body) && Objects.equals(id, other.id);
15678
}
15779

15880
@Override
15981
public String toString() {
160-
return "Note [author=" + author + ", awardEmoji=" + awardEmoji + ", body=" + body + ", createdAt=" + createdAt + ", id=" + id + ", lastEditedAt=" + lastEditedAt + ", system=" + system + ", systemNoteIconName=" + systemNoteIconName + ", updatedAt=" + updatedAt + ", url=" + url + "]";
82+
return "Note [author=" + author + ", awardEmoji=" + awardEmoji + ", body=" + body + ", id=" + id + "]";
16183
}
16284

16385
}

quarkus-graphql-client/src/main/java/gitlab/model/UserCore.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
@Name("UserCore")
1111
public class UserCore {
1212

13-
/**
14-
* Indicates if the user is active.
15-
*/
16-
private Boolean active;
1713
/**
1814
* ID of the user.
1915
*/
@@ -23,15 +19,6 @@ public class UserCore {
2319
*/
2420
private String username;
2521

26-
public Boolean getActive() {
27-
return active;
28-
}
29-
30-
public UserCore setActive(Boolean active) {
31-
this.active = active;
32-
return this;
33-
}
34-
3522
public String getId() {
3623
return id;
3724
}
@@ -52,7 +39,7 @@ public UserCore setUsername(String username) {
5239

5340
@Override
5441
public int hashCode() {
55-
return Objects.hash(active, id, username);
42+
return Objects.hash(id, username);
5643
}
5744

5845
@Override
@@ -64,12 +51,12 @@ public boolean equals(Object obj) {
6451
if (getClass() != obj.getClass())
6552
return false;
6653
UserCore other = (UserCore) obj;
67-
return Objects.equals(active, other.active) && Objects.equals(id, other.id) && Objects.equals(username, other.username);
54+
return Objects.equals(id, other.id) && Objects.equals(username, other.username);
6855
}
6956

7057
@Override
7158
public String toString() {
72-
return "UserCore [active=" + active + ", id=" + id + ", username=" + username + "]";
59+
return "UserCore [id=" + id + ", username=" + username + "]";
7360
}
7461

7562
}

0 commit comments

Comments
 (0)