Skip to content

Commit 2800866

Browse files
committed
feat: expose Project.name in graphql
1 parent 6f89e0c commit 2800866

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/main/java/io/papermc/fill/controller/GraphQueryController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ public String mapProjectId(final ProjectEntity project) {
9595
return project.id();
9696
}
9797

98+
@SchemaMapping(typeName = "Project", field = "name")
99+
public String mapProjectName(final ProjectEntity project) {
100+
return project.name();
101+
}
102+
98103
@SchemaMapping(typeName = "Project", field = "families")
99104
public List<FamilyEntity> mapProjectFamilies(
100105
final ProjectEntity project
@@ -134,9 +139,9 @@ public List<VersionEntity> mapProjectVersions(
134139
Stream<VersionEntity> versions = this.versions.findAllByProject(project);
135140
versions = versions.sorted(Version.COMPARATOR_CREATED_AT_REVERSE);
136141
if (filterBy != null) {
137-
final String familyId = filterBy.familyId();
138-
if (familyId != null) {
139-
versions = versions.filter(version -> version.family().id().equals(familyId));
142+
final String filterByFamilyId = filterBy.familyId();
143+
if (filterByFamilyId != null) {
144+
versions = versions.filter(version -> version.family().id().equals(filterByFamilyId));
140145
}
141146
final SupportStatus filterBySupportStatus = filterBy.supportStatus();
142147
if (filterBySupportStatus != null) {

src/main/resources/graphql/schema.graphqls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ type Mutation {
4545
type Project {
4646
id: String!
4747

48+
name: String!
49+
4850
families: [Family]
4951

5052
family(

0 commit comments

Comments
 (0)