You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2026. It is now read-only.
Following the refactoring and creation of the MediaStatus entities (referencing PRs #86 and #87), we need to expose this data via GraphQL so the client/frontend can consume it (e.g., to populate filter dropdowns or media creation forms).
The goal of this issue is to create only the Queries to fetch all available categories and statuses.
⚠️Important: No Mutations should be implemented in this PR. The scope is strictly read-only (Queries).
✅ Tasks (To-Do)
Update the schema.graphqls file by adding the type definitions for MediaStatus.
Add the findAllMediaStatuses queries (or equivalent naming) to the Query type in the schema (always fetching by user).
Implement the corresponding Spring Boot Controllers/DataFetchers to handle these queries using their respective Repositories.
Write automated tests to ensure the queries return the correct data.
Must accept filters to get by MediaCategories, Generes, name media, alternative title.
🧪 Testing Requirements
Since we won't have mutations to create these records in the database via the API, the Arrange phase of the tests cannot rely on GraphQL.
The tests must:
Insert the test data directly into the database.
Execute the GraphQL fetch query.
Validate if the returned payload exactly matches the data inserted into the database.
💡 Senior Dev Note / Tip for Testing:
The best approach here is to use the @Sql(scripts = "/insert-categories-statuses.sql") annotation above your test method or class. This guarantees that the Spring test database (whether H2 or Testcontainers) is properly populated before your GraphQL call is triggered. This keeps the test isolated and independent of creation routes that don't even exist yet. Alternatively, you can use the Repositories (saveAll) directly in the @BeforeEach setup.
📝 Description
Following the refactoring and creation of the
MediaStatusentities (referencing PRs #86 and #87), we need to expose this data via GraphQL so the client/frontend can consume it (e.g., to populate filter dropdowns or media creation forms).The goal of this issue is to create only the Queries to fetch all available categories and statuses.
✅ Tasks (To-Do)
schema.graphqlsfile by adding thetypedefinitions forMediaStatus.findAllMediaStatusesqueries (or equivalent naming) to theQuerytype in the schema (always fetching by user).🧪 Testing Requirements
Since we won't have mutations to create these records in the database via the API, the Arrange phase of the tests cannot rely on GraphQL.
The tests must:
🔗 References