strawberry icon indicating copy to clipboard operation
strawberry copied to clipboard

Fix usage with default and default_factory arguments

Open devkral opened this issue 2 years ago • 3 comments

Description

Currently it is not always possible to use the default and default_factory argument on strawberry.field. It fails randomly and especially on root Query This PR fixes the issue.

Types of Changes

  • [ ] Core
  • [x] Bugfix
  • [ ] New feature
  • [ ] Enhancement/optimization
  • [ ] Documentation

Issues Fixed or Closed by This PR

Checklist

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have added tests to cover my changes.
  • [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

devkral avatar Jan 10 '24 07:01 devkral

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


Fix using strawberry with default or default_factory (dataclasses basics)

Here's the tweet text:

🆕 Release (next) is out! Thanks to Alexander for the PR 👏

Get it here 👉 https://beta.strawberry.rocks/release/(next)

botberry avatar Jan 10 '24 07:01 botberry

Codecov Report

Merging #3333 (830a729) into main (ba65949) will decrease coverage by 0.02%. The diff coverage is 84.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3333      +/-   ##
==========================================
- Coverage   96.62%   96.61%   -0.02%     
==========================================
  Files         485      485              
  Lines       30292    30316      +24     
  Branches     3746     3751       +5     
==========================================
+ Hits        29271    29291      +20     
- Misses        832      835       +3     
- Partials      189      190       +1     

codecov[bot] avatar Jan 10 '24 07:01 codecov[bot]

CodSpeed Performance Report

Merging #3333 will not alter performance

Comparing devkral:fix/root_defaults (830a729) with main (ba65949)

Summary

✅ 12 untouched benchmarks

codspeed-hq[bot] avatar Jan 10 '24 07:01 codspeed-hq[bot]