strawberry-graphql / strawberry-django

Strawberry GraphQL Django extension
https://strawberry.rocks/docs/django
MIT License
409 stars 118 forks source link

New Feature: Optional custom key_attr to that can be used instead of id (pk) in to access model in Django UD mutations (Issue #348) #387

Closed thepapermen closed 11 months ago

thepapermen commented 12 months ago

Description

Types of Changes

Issues Fixed or Closed by This PR

Checklist

codecov-commenter commented 12 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (fe450f3) 87.96% compared to head (49748bc) 87.46%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #387 +/- ## ========================================== - Coverage 87.96% 87.46% -0.50% ========================================== Files 33 35 +2 Lines 2983 3024 +41 ========================================== + Hits 2624 2645 +21 - Misses 359 379 +20 ``` | [Files](https://app.codecov.io/gh/strawberry-graphql/strawberry-graphql-django/pull/387?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=strawberry-graphql) | Coverage Δ | | |---|---|---| | [strawberry\_django/mutations/fields.py](https://app.codecov.io/gh/strawberry-graphql/strawberry-graphql-django/pull/387?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=strawberry-graphql#diff-c3RyYXdiZXJyeV9kamFuZ28vbXV0YXRpb25zL2ZpZWxkcy5weQ==) | `86.25% <100.00%> (+0.08%)` | :arrow_up: | | [strawberry\_django/mutations/mutations.py](https://app.codecov.io/gh/strawberry-graphql/strawberry-graphql-django/pull/387?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=strawberry-graphql#diff-c3RyYXdiZXJyeV9kamFuZ28vbXV0YXRpb25zL211dGF0aW9ucy5weQ==) | `92.85% <ø> (ø)` | | | [strawberry\_django/permissions.py](https://app.codecov.io/gh/strawberry-graphql/strawberry-graphql-django/pull/387?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=strawberry-graphql#diff-c3RyYXdiZXJyeV9kamFuZ28vcGVybWlzc2lvbnMucHk=) | `80.42% <100.00%> (+0.55%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/strawberry-graphql/strawberry-graphql-django/pull/387/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=strawberry-graphql)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

g-as commented 11 months ago

Can this be extended to queries?

https://strawberry-graphql.github.io/strawberry-graphql-django/guide/queries/

bellini666 commented 11 months ago

Can this be extended to queries?

https://strawberry-graphql.github.io/strawberry-graphql-django/guide/queries/

Yes, for sure!

Someone started to implement that for queries in this PR, but he will not be working on it anymore.

PRs (either a new one or a continuation of that existing one) are welcomed :)

g-as commented 11 months ago

Copy. I'll see what I can do. Thx