Skip to content

Conversation

@lamplis
Copy link
Contributor

@lamplis lamplis commented Jan 7, 2026

Problem

The GraphQL API was failing with the error:

Cannot return null for non-nullable field Set.serie

This was happening because the setToSetSimple function in server/compiler/utils/setUtil.ts was not including the serie field in the returned SetResume object.

The GraphQL schema defines Set.serie as non-nullable (serie: Serie!), but cards were being compiled with set objects that had no serie field, causing GraphQL queries to fail.

Solution

Added the serie field to the SetResume object returned by setToSetSimple:

serie: {
    id: set.serie.id,
    name: resolveText(set.serie.name, lang)
}

This matches the structure used in setToSetSingle and ensures all card objects have the required serie reference in their set objects.

Testing

  • ✅ TypeScript validation passes
  • ✅ Server compilation succeeds
  • ✅ All cards now have set.serie field populated
  • ✅ GraphQL queries should no longer fail with null serie errors

Related Issues

This fixes the test failures in PR #1049 and any other PRs that were encountering the "Cannot return null for non-nullable field Set.serie" error.

The setToSetSimple function was missing the serie field in the returned
SetResume object, causing GraphQL queries to fail with 'Cannot return null
for non-nullable field Set.serie' error.

This fix adds the serie field with id and name to match the GraphQL schema
requirement that Set.serie is non-nullable.

Fixes the issue where cards' set objects were missing the serie reference,
which was causing GraphQL API tests to fail.
@lamplis lamplis force-pushed the fix/graphql-set-serie-null-error branch from f936a83 to a4df2dc Compare January 7, 2026 10:29
@Aviortheking
Copy link
Member

Hi, before posting a PR with a change that will reflect in both the GraphQL & the REST API, can you please first create an issue depicting the problem.

@lamplis lamplis deleted the fix/graphql-set-serie-null-error branch January 9, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants