strawberry-graphql / strawberry-sqlalchemy

A SQLAlchemy Integration for strawberry-graphql
MIT License
91 stars 26 forks source link

Implement Standalone Convert; Enum Handling; User Edge/Connection Classes; Column Alias Handling #25

Open gravy-jones-locker opened 1 year ago

gravy-jones-locker commented 1 year ago

Description

This includes a number of changes, including:

  1. mapper.type now calls mapper.convert - this allows mapper.convert to be called within user code, which makes the relevant functionality accessible where a decorator is not appropriate.
  2. strawberry.enum is called against SQLAlchemy Enum columns.
  3. Rather than relying on dynamically generated, model specific classes, the user can now pass Edge and Connection classes to the mapper constructor. This is necessary where those Edge/Connection classes are used elsewhere in user schemas.
  4. Relationship mapping is updated such that user-defined column names are taken into account rather than just model attribute names.

Types of Changes

Issues Fixed or Closed by This PR

*

Checklist

Ckk3 commented 1 year ago

up

botberry commented 1 year ago

Hi, thanks for contributing to Strawberry 🍓!

We noticed that this PR is missing a RELEASE.md file. We use that to automatically do releases here on GitHub and, most importantly, to PyPI!

So as soon as this PR is merged, a release will be made 🚀.

Here's an example of RELEASE.md:

Release type: patch

Description of the changes, ideally with some examples, if adding a new feature.

Release type can be one of patch, minor or major. We use semver, so make sure to pick the appropriate type. If in doubt feel free to ask :)

erikwrede commented 3 months ago

Hey, let's delay the enum part of this until we've standardized https://github.com/strawberry-graphql/strawberry/issues/3543 This will allow us to just use any enum and have strawberry's core logic handle the rest.