Skip to content

Replace deprecated Strawberry scalar registration for BigInt #21735

@pheus

Description

@pheus

Proposed Changes

NetBox defines the GraphQL BigInt scalar in netbox/netbox/graphql/scalars.py by passing a class directly to strawberry.scalar(). When the development server is run with warnings enabled, Strawberry emits a deprecation warning during startup (currently twice):

python3 -Wd netbox/manage.py runserver 0.0.0.0:8000
/netbox/netbox/graphql/scalars.py:5: DeprecationWarning: Passing a class to strawberry.scalar() is deprecated. Use StrawberryConfig.scalar_map instead for better type checking support. See: https://strawberry.rocks/docs/types/scalars
  BigInt = strawberry.scalar(

This scalar registration should be updated to use Strawberry's supported configuration mechanism, such as StrawberryConfig.scalar_map or the current upstream-recommended equivalent, instead of the deprecated strawberry.scalar() pattern. The goal is to preserve the existing GraphQL behavior for BigInt while eliminating the warning from development and test runs.

No user-facing changes to workflows, data models, or the UI are expected.

Justification

This is a codebase-only cleanup that keeps NetBox aligned with Strawberry's supported API and reduces warning noise for developers running NetBox with warnings enabled. Addressing it now should help avoid future breakage once the deprecated behavior is removed upstream, and it keeps local development and CI output cleaner when deprecations are surfaced more aggressively.

Metadata

Metadata

Assignees

Labels

netboxstatus: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions