Closes #21735: Replace deprecated Strawberry scalar for BigInt #97

Closed
opened 2026-04-05 16:21:39 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 3/23/2026

Fixes: #21735

Replace the deprecated strawberry.scalar() class-based registration of BigInt with the approach recommended by Strawberry's current API.

BigInt is now defined as a NewType in scalars.py, and the corresponding GraphQL scalar (BigIntScalar) is registered via StrawberryConfig.scalar_map in schema.py. The exported name BigInt is unchanged, so existing field annotations throughout the codebase continue to work without modification.

This eliminates the DeprecationWarning that currently appears (twice) on startup when running with warnings enabled, and keeps NetBox aligned with Strawberry's supported API ahead of the eventual removal of the old pattern.

*Originally created by @pheus on 3/23/2026* ### Fixes: #21735 Replace the deprecated `strawberry.scalar()` class-based registration of `BigInt` with the approach recommended by Strawberry's current API. `BigInt` is now defined as a `NewType` in `scalars.py`, and the corresponding GraphQL scalar (`BigIntScalar`) is registered via `StrawberryConfig.scalar_map` in `schema.py`. The exported name `BigInt` is unchanged, so existing field annotations throughout the codebase continue to work without modification. This eliminates the `DeprecationWarning` that currently appears (twice) on startup when running with warnings enabled, and keeps NetBox aligned with Strawberry's supported API ahead of the eventual removal of the old pattern.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#97