Skip to content

Commit

Permalink
docs: add some TODO comments for the future
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 committed Dec 6, 2023
1 parent 51db133 commit 9ef9785
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/strawberry_sqlalchemy_mapper/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def resolve_nodes(s: Session, nodes=nodes):
)
)

# TODO: It would be better to aboid session.run_sync in here but
# sqlakeyset doesn't have a `get_page` async counterpart.
if isinstance(session, AsyncSession):

async def resolve_async(nodes=nodes):
Expand Down Expand Up @@ -366,6 +368,8 @@ def resolve_model_node(
try:
return results.one()
except NoResultFound:
# If returning a single result fails, return `None` if this wasn't
# required, otherwise reraise the exception
if not required:
return None

Expand Down Expand Up @@ -411,4 +415,6 @@ def resolve_model_id(
id_attr = cast(relay.Node, source).resolve_id_attr().split("|")

assert id_attr
# TODO: Maybe we can work with the tuples directly in the future?
# We would need to add support on strawberry for that first though.
return "|".join(str(getattr(root, k)) for k in id_attr)

0 comments on commit 9ef9785

Please sign in to comment.