Graphene-sqlalchemy

Latest version: v2.3.0

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

3.0.0rc1

RELEASE CANDIDATE
This is the last release with feature additions before we move graphene-sqlalchemy 3.0 to GA 🎉
We have implemented some awesome new features, including new filters, and SQLAlchemy 2.0 support that we are very excited about.

Please test this release and report any issues you find so we can fix them for the release.

**When upgrading and testing, please take care of the previous release notes and look at the following breaking changes PR**:
https://github.com/graphql-python/graphene-sqlalchemy/pull/371

If you are using hybrid properties as fields in your GraphQL schema in combination with `from __future___ import annotations`, this issue might affect you. We are actively working towards a fix for `str,bool` and other primitives.
https://github.com/graphql-python/graphene-sqlalchemy/issues/396

A more detailed upgrade guide summarizing all beta releases will be published with the full release.



What's Changed

Filters are out in early access 🎉
**Graphene SQLAlchemy 3.0 will provide a completely overhauled filtering syntax, removing the need for an external plugin.** We support automatically filtering over relationships and complex filter types as well as easy customization. Please check out the docs here and give us feedback about your experience! 😊
https://graphql-python.github.io/graphene-sqlalchemy/filters.html

Add Filters by sabard in https://github.com/graphql-python/graphene-sqlalchemy/pull/357

Other contributions since the last beta release
* docs: update PyPI page by sabard in https://github.com/graphql-python/graphene-sqlalchemy/pull/384
* fix: set README content_type by sabard in https://github.com/graphql-python/graphene-sqlalchemy/pull/385
* feat: SQLAlchemy 2.0 support by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/368
* Add database session to the example by clemens-tolboom in https://github.com/graphql-python/graphene-sqlalchemy/pull/249
* association_proxy support by dpep in https://github.com/graphql-python/graphene-sqlalchemy/pull/267
* Recreate loader if old loader is on different loop by zeptonaut in https://github.com/graphql-python/graphene-sqlalchemy/pull/395
* fix: keep converting tuples to strings for composite primary keys in relay ID field by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/399

New Contributors
* zeptonaut made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/395

**Full Changelog**: https://github.com/graphql-python/graphene-sqlalchemy/compare/v3.0.0b4...v3.0.0rc1
**Full Changelog since 2.x**: https://github.com/graphql-python/graphene-sqlalchemy/compare/2.3.0...v3.0.0rc1

Thanks to everyone that contributed to this release and supported our biweekly maintainer meetings. We are looking forward to your feedback and appreciate any PRs 😊

3.0.0b4

What's Changed
* Enable sorting when batching is enabled by PaulSchweizer in https://github.com/graphql-python/graphene-sqlalchemy/pull/355
* Add Black to pre-commit by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/361
* Fix: RelationshipLoader should utilize DataLoader from the `get_data_loader_impl()` function, and not directly from aiodataloader library by flipbit03 in https://github.com/graphql-python/graphene-sqlalchemy/pull/362
* Add support for UUIDs in `hybrid_property` by flipbit03 in https://github.com/graphql-python/graphene-sqlalchemy/pull/363
* chore: limit CI runs to master pushes & PRs by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/366
* Support GQL interfaces for polymorphic SQLA models by polgfred in https://github.com/graphql-python/graphene-sqlalchemy/pull/365
* feat(async): add support for async sessions by jendrikjoe in https://github.com/graphql-python/graphene-sqlalchemy/pull/350
* Fix installation instruction: '--pre' instead of '>=3' by zahrevsky in https://github.com/graphql-python/graphene-sqlalchemy/pull/372
* refactor!: use the same conversion system for hybrids and columns by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/371
* Stricter non-null fields for relationships by polgfred in https://github.com/graphql-python/graphene-sqlalchemy/pull/367
* fix singledispatch inheritance by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/377
* chore: limit lint runs to master pushes and PRs by sabard in https://github.com/graphql-python/graphene-sqlalchemy/pull/382
* fix: warnings in docs build by sabard in https://github.com/graphql-python/graphene-sqlalchemy/pull/383

New Contributors
* PaulSchweizer made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/355
* polgfred made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/365
* jendrikjoe made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/350
* zahrevsky made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/372
* sabard made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/382

**Full Changelog**: https://github.com/graphql-python/graphene-sqlalchemy/compare/3.0.0b3...v3.0.0b4

3.0.0b3

This is a small fix. Graphene `DataLoader` is used when using `graphene>=3.1.1` to allow for more frequent updates to DataLoaders & fix issues with `pytest`.
Please check the `graphene` release notes to learn more: https://github.com/graphql-python/graphene/releases/tag/v3.1.1


What's Changed
* Use Graphene DataLoader in graphene>=3.1.1 by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/360


**Full Changelog**: https://github.com/graphql-python/graphene-sqlalchemy/compare/3.0.0b2...3.0.0b3

3.0.0b2

What's Changed

Extended Support for `hybrid_property`
In older versions, hybrid properties of an SQLAlchemy model were converted to Strings in the `SQLAlchemyObjectType`, unless overridden by an `ORMField`. This release includes support for automatic type detection based on the type hints of the method.

Old Behavior
python
class Interval(Base):

id = Column(Integer, primary_key=True)
start = Column(Integer, nullable=False)
end = Column(Integer, nullable=False)

hybrid_property
def length(self):
return self.end - self.start

class GQLInterval(SQLAlchemyObjectType):
class Meta:
model = Interval


GraphQL Schema:
graphql
type Interval {
id: ID!
start: Int!
end: Int!
length: String
}


New Behavior

python
class Interval(Base):
Fields from above

hybrid_property
def length(self) -> int:
return self.end - self.start

class GQLInterval(SQLAlchemyObjectType):
class Meta:
model = Interval


GraphQL Schema:
graphql
type Interval {
id: ID!
start: Int!
end: Int!
length: Int
}


The feature supports all basic python types (340) , ObjectTypes and Unions of ObjectTypes (`Union[T1,T2]` or 3.10-style: `T1 | T2`).
Adding additional converters is possible similar to column type converters using `convert_sqlalchemy_hybrid_property_type.register(matcher)`. See `converter.py` for examples.

This feature is experimental and subject to extension (`NonNull` Support, Hybrid Methods, `property` support). If you encounter an issue, see room for improvement or want to help extend the feature, please open an issue!


* Support setting hybrid_property's return type from the functions type annotations. by flipbit03 in https://github.com/graphql-python/graphene-sqlalchemy/pull/340
* Supplant hybrid_property's type annotation support with `Optional[T]` by flipbit03 in https://github.com/graphql-python/graphene-sqlalchemy/pull/343

Docstring Support for `hybrid_property`
The default behavior was changed to include the docstrings of hybrid property methods into the schema, similar to the docstrings of the column. This can be overridden using an `ORMField` providing an empty docstring.
* Pick up the docstrings of hybrid properties by bim9262 in https://github.com/graphql-python/graphene-sqlalchemy/pull/344


Changes to existing Column Type converters

This PR brought updates and additions to type converters. Some type converters were adjusted to map to the correct graphene scalar type. The changes might reflect in your schema types.

| Type | Old Scalar | New Scalar |
|---------------------------|-------------------|-------------------------|
| `sqa.Date` | `graphene.String` | `graphene.Date` |
| `sqa.Time` | `graphene.String` | `graphene.Time` |
| `sqa.DateTime` | `graphene.String` | `graphene.DateTime` |
| `postgresql.UUID` | `graphene.String` | `graphene.UUID` |
| `sqa_utils.UUID` | --- | `graphene.UUID` |
| `sqa.Variant` | --- | Converts `Variant.impl` |
| `sqa_utils.IPAddressType` | --- | `graphene.String` |
| `sqa_utils.EmailType` | --- | `graphene.String` |
| `sqa_utils.URLType` | --- | `graphene.String` |


Additionally, Enums are now generated from `Column.key` instead of `Column.name`. See 301

* Native support for additional Type Converters by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/353


**Other changes**

* Build clean up by mvanlonden in https://github.com/graphql-python/graphene-sqlalchemy/pull/318
* I resolved spelling and capitalization mistakes in the file, `README.md`. by quinnkj in https://github.com/graphql-python/graphene-sqlalchemy/pull/290
* Fix for import from graphql-relay-py (329) by Cito in https://github.com/graphql-python/graphene-sqlalchemy/pull/330
* Fix for issue graphql-python/graphene-sqlalchemy288 by jbeard4 in https://github.com/graphql-python/graphene-sqlalchemy/pull/289
* Don't suppress SQLAlchemy errors when mapping classes by connorbrinton in https://github.com/graphql-python/graphene-sqlalchemy/pull/169
* Pick up the docstrings of hybrid properties by bim9262 in https://github.com/graphql-python/graphene-sqlalchemy/pull/344
* Add Python 3.10 Support & update pre-commit hooks by erikwrede in https://github.com/graphql-python/graphene-sqlalchemy/pull/352

New Contributors
* quinnkj made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/290
* jbeard4 made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/289
* connorbrinton made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/169
* flipbit03 made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/340
* bim9262 made their first contribution in https://github.com/graphql-python/graphene-sqlalchemy/pull/344

**Full Changelog**: https://github.com/graphql-python/graphene-sqlalchemy/compare/3.0.0b1...3.0.0b2

3.0.0b1

Upgrade to v3 🎉
- Now supports sqlalchemy v1.4
- Replaces the promises.dataloader with aiodataloader making batched queries asyncio-dependant

2.3.0

Batching

Batching can be now enabled via the `batching` param:
- we can configure all the fields of a type at once via `SQLAlchemyObjectType.meta.batching`
- or we can specify it for a specific field via `ORMfield.batching`. This trumps `SQLAlchemyObjectType.meta.batching`.

See relevant PR: https://github.com/graphql-python/graphene-sqlalchemy/pull/253 https://github.com/graphql-python/graphene-sqlalchemy/pull/254 https://github.com/graphql-python/graphene-sqlalchemy/pull/260

Add support for Non-Null SQLAlchemyConnectionField

See https://github.com/graphql-python/graphene-sqlalchemy/pull/261

Simplify access to model Connection

One can access the connection on the `SQLAlchemyObjectType` directly. ex: `MyModel.connection`

And other minor fixes

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.