saleor
saleor copied to clipboard
Add custom datetime scalar
I want to merge this change because it adds our own DateTime scalar. The graphene scalar doesn't validate if provided datetime, after converting to UTC time doesn't exceed the datetime's min, max values. For example when using input like this one: "0001-01-01T00:00:01+07:00", it will be saved on DB as -> 0001-12-31 17:00:01+00 BC. When fetching the details from DB and casting it to datetime instance, datetime module will raise an exception, as the value is lower than the datetime.min.
Port of changes from #16202
Impact
- [ ] New migrations
- [ ] New/Updated API fields or mutations
- [ ] Deprecated API fields or mutations
- [ ] Removed API types, fields, or mutations
Docs
- [ ] Link to documentation:
Pull Request Checklist
- [ ] Privileged queries and mutations are either absent or guarded by proper permission checks
- [ ] Database queries are optimized and the number of queries is constant
- [ ] Database migrations are either absent or optimized for zero downtime
- [ ] The changes are covered by test cases
- [ ] All new fields/inputs/mutations have proper labels added (
ADDED_IN_X
,PREVIEW_FEATURE
, etc.) - [ ] All migrations have proper dependencies
- [ ] All indexes are added concurrently in migrations
- [ ] All RunSql and RunPython migrations have revert option defined