Repository navigation
Migrate the BigInt scalar to StrawberryConfig.scalar_map and raise the supported
strawberry-graphql and Python versions.
BigInt was built by passing a type to strawberry.scalar(), a pattern deprecated in
strawberry-graphql 0.288.0, so simply importing strawberry_sqlalchemy_mapper emitted a
DeprecationWarning. BigInt is now a plain NewType and its scalar definition is exposed as
strawberry_sqlalchemy_scalar_map.
Fixes #259.
Breaking Changes:
- If your models use
BigIntegercolumns, you must now register the scalar map on your schema:
import strawberry
from strawberry.schema.config import StrawberryConfig
from strawberry_sqlalchemy_mapper import strawberry_sqlalchemy_scalar_map
schema = strawberry.Schema(
query=Query,
config=StrawberryConfig(scalar_map=strawberry_sqlalchemy_scalar_map),
)If you already maintain your own scalar_map, merge the two:
config = StrawberryConfig(
scalar_map={**strawberry_sqlalchemy_scalar_map, **my_scalar_map},
)Forgetting to register it raises TypeError: ... fields cannot be resolved. Unexpected type '...BigInt' when the schema is built.
See Custom scalars in the Strawberry
documentation for more about scalar_map.
-
The minimum
strawberry-graphqlversion is now 0.288.0, which is wherescalar_mapwas added. -
Python 3.8 and 3.9 are no longer supported.
strawberry-graphql0.288.0 requires Python 3.10
or newer, and both versions have reached end of life. -
Combining
firstwithbeforeon a connection now returns a different page. Older
strawberry-graphqlreleases walked backward from thebeforecursor, effectively behaving
likelast. This was corrected instrawberry-graphql
0.322.2, sobefore
now bounds the range andfirsttakes from its start, per the Relay Cursor Connections spec.
Queries relying on the previous behaviour should uselast. -
Relay node ids are now exposed as the
IDscalar instead ofGlobalID, following the
relay_use_legacy_global_iddefault in newerstrawberry-graphqlversions. Queries written
against the generated schema must useID(for examplequery Fruit($id: ID!)). Pass
StrawberryConfig(relay_use_legacy_global_id=True)to keep the previousGlobalIDnaming.
Fixes:
import strawberry_sqlalchemy_mapperno longer emits aDeprecationWarning.Edge.resolve_edgenow accepts the additional keyword arguments itsstrawberry.relay
supertype may pass to it.
Internal:
- Removed the
sys.version_infobranches that supported Python 3.8/3.9, in
strawberry_sqlalchemy_mapper/__init__.pyand the annotation merging in
StrawberrySQLAlchemyMapper.type(). - Dropped the
importlib-metadatadependency, unused now thatimportlib.metadatais always
available. - Declared
typing-extensionsas an explicit dependency. It is imported directly by the mapper
but was previously only installed as a transitive dependency ofstrawberry-graphql. - Updated development dependencies:
ruff0.16,mypy2.3,pytest9,pytest-asyncio1.4,
pytest-cov7,pytest-codspeed5,pytest-mypy-plugins4,pytest-xdist3.8 andnox2026. - Set the
rufftarget andpyrightversion to Python 3.10, ignored the additional rules that
conflict with the project's runtime-typing conventions (UP035,UP045,CPY001,PLC0415,
PLW0108,PYI061,PYI016,FURB110), and removedANN101/ANN102, whichruffno longer
implements. - Updated the CI test matrix,
noxfile.py, the devcontainer image, Read the Docs and the
GitHub action images to Python 3.10. - Added
tests/test_scalars.py, covering theBigIntscalar: schema registration, the
BigIntegercolumn mapping and serialization of values above 32 bits.