8000 Releases Β· strawberry-graphql/strawberry-sqlalchemy Β· GitHub
[go: up one dir, main page]

Skip to content

Releases: strawberry-graphql/strawberry-sqlalchemy

8000

πŸ“ 0.6.4

08 Jul 19:27
Compare
Choose a tag to compare

This release improves how types inherit fields from other mapped types using @mapper.type(...).
You can now safely inherit from another mapped type, and the resulting GraphQL type will include all expected fields with predictable conflict resolution.

Some examples:

  • Basic Inheritance:
@mapper.type(ModelA)
class ApiA:
    pass


@mapper.type(ModelB)
class ApiB(ApiA):
    # ApiB inherits all fields declared in ApiA
    pass
  • The __exclude__ option continues working:
@mapper.type(ModelA)
class ApiA:
    __exclude__ = ["relationshipB_id"]


@mapper.type(ModelB)
class ApiB(ApiA):
    # ApiB will have all fields declared in ApiA, except "relationshipB_id"
    pass
  • If two SQLAlchemy models define fields with the same name, the field from the model inside .type(...) takes precedence:
class ModelA(base):
    __tablename__ = "a"

    id = Column(String, primary_key=True)
    example_field = Column(String(50))


class ModelB(base):
    __tablename__ = "b"

    id = Column(String, primary_key=True)
    example_field = Column(Integer, autoincrement=True)


@mapper.type(ModelA)
class ApiA:
    # example_field will be a String
    pass


@mapper.type(ModelB)
class ApiB(ApiA):
    # example_field will be taken from ModelB and will be an Integer
    pass
  • If a field is explicitly declared in the mapped type, it will override any inherited or model-based definition:
class ModelA(base):
    __tablename__ = "a"

    id = Column(String, primary_key=True)
    example_field = Column(String(50))


class ModelB(base):
    __tablename__ = "b"

    id = Column(String, primary_key=True)
    example_field = Column(Integer, autoincrement=True)


@mapper.type(ModelA)
class ApiA:
    pass


@mapper.type(ModelB)
class ApiB(ApiA):
    # example_field will be a Float
    example_field: float = strawberry.field(name="exampleField")

Releases contributed by @Ckk3 via #253

πŸ“ 0.6.3

21 Jun 03:37
Compare
Choose a tag to compare

This update helps verify compatibility with Python 3.13.

  • Added new test environments in the CI pipeline to ensure compatibility with Python 3.13.
  • No changes to runtime code or dependencies.

Releases contributed by @Ckk3 via #254

πŸ“ 0.6.2

24 May 15:58
Compare
Choose a tag to compare

This release does not introduce any new features or bug fixes. It focuses solely on internal code quality improvements.

Changes:

  • Added Mypy configuration aligned with the main Strawberry project.
  • Enforced type checking via CI to ensure consistency.
  • Ran pre-commit across all files to standardize formatting and follow the project's linting architecture.

These changes aim to improve maintainability and ensure better development practices moving forward.

Releases contributed by @Ckk3 via #250

πŸ“ 0.6.1

13 May 14:22
Compare
Choose a tag to compare

Ensure association proxy resolvers return valid relay connections, including page_info and edge cursor details, even for empty results.

Thanks to https://github.com/tylernisonoff for the original PR.

Releases contributed by @Ckk3 via #241

πŸ“ 0.6.0

25 Apr 13:31
Compare
Choose a tag to compare

Added support for GraphQL directives in the SQLAlchemy type mapper, enabling better integration with GraphQL federation.

Example usage:

@mapper.type(Employee, directives=["@deprecated(reason: 'Use newEmployee instead')"])
class Employee:
    pass

Releases contributed by @csechrist via #204

πŸ“ 0.5.0

12 Nov 13:10
Compare
Choose a tag to compare

Add an optional function to exclude relationships from relay pagination and use traditional strawberry lists.
Default behavior preserves original behavior for backwords compatibilty.

Releases contributed by @fruitymedley via #168

πŸ“ 0.4.5

17 Oct 21:28
Compare
Choose a tag to compare

Updated imports to be compatible with strawberry 0.236.0
Increased the minimum required strawberry version to 0.236.0

Releases contributed by @novag via #187

πŸ“ 0.4.4

02 Oct 09:13
Compare
Choose a tag to compare

Resolved an issue with the BigInt scalar definition, ensuring compatibility with Python 3.8 and 3.9. The missing name parameter was added to prevent runtime errors.
Fixed failing CI tests by updating the GitHub Actions workflow to improve test stability.

Releases contributed by @Ckk3 via #190

πŸ“ 0.4.3

22 May 14:26
Compare
Choose a tag to compare

Fix an issue where auto generated connections were missing some expected
attributes to be properly instantiated.

Releases contributed by @bellini666 via #137

πŸ“ 0.4.2

29 Dec 21:02
Compare
Choose a tag to compare

This change implements a new custom scalar BigInt that is mapped to SQLAlchemy's BigInteger.

Releases contributed by @IdoKendo via #101

0