Skip to content

Commit ea2b8d1

Browse files
committed
feat: expose Project.name in graphql
1 parent 9cca7d1 commit ea2b8d1

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
@@ -96,6 +96,11 @@ public String mapProjectId(final ProjectEntity project) {
9696
return project.id();
9797
}
9898

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

src/main/resources/graphql/schema.graphqls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type Mutation {
3333
type Project {
3434
id: String!
3535

36+
name: String!
37+
3638
families: [Family]
3739

3840
family(

0 commit comments

Comments
 (0)