Commit Graph

25 Commits

Author SHA1 Message Date
Rustam Ganeyev
1281c1338d
Introduced optional_fields to SerializationMutation (#1080)
* added optional_field to SerializationMutation to forcefully mark some fields as optional

* added tests
2021-01-01 20:36:50 -08:00
CBuiVNG
65f41c1a17
BUGFIX: don't filter out lookup_field as input (required for update) (#1029) 2020-10-19 17:25:35 +01:00
Josh Warwick
19e3eddddb
Allow passing of meta object in SerializerMutation options (#1028) 2020-08-26 16:03:08 +01:00
Amim Knabben
a12fc9299a
Exclude read_only fields from input (#882) 2020-02-23 09:48:33 +00:00
B4rtware
6a19ab5a4b
use to_representation in favor of get_attribute (#848)
* use `to_represenation` in favor of `get_attribute`

* fix datetime type does get converted to a string

to_representation will convert the datetime field into a string representation. However the to_representation on the method field will only call its underlying method.

* fix add missing import

* apply black formatter

* add test for serializer method field

* apply black format

* improve backward compatibility

by using date's class contructor instead of fromisostring

* apply black format

* fix black format issue
2020-02-21 17:42:47 +00:00
Leeward Bound
83bc32bc9d
Adding support for disabling enum creation on SerializerMutation (#851) 2020-02-07 10:17:56 +00:00
dan-klasson
7940a7b954 added support for partial updates in serializers (#731)
* added support for partial updates in serializers

* Add test to verify partial updates

Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
2019-12-27 14:46:48 +00:00
Konstantin Alekseev
e2e496f505 Apply camel case converter to field names in DRF errors (#514)
* Apply camel case converter to field names in DRF errors

* Implement recursive error camelize, add setting.
2019-06-25 09:40:29 +01:00
Jonathan Kim
692540cc78
Update flake8 (#688)
* Include setup.py in black formatting

* Add new flake8 plugins and update errors to look for

* Fix duplicate test name

* Don't use mutable data structure

* Install all dev dependencies for flake8 and black tox envs
2019-06-24 18:55:44 +01:00
kamilkijak
c90c27f364 Add support for write_only fields in SerializerMutation (#555) 2019-06-09 16:25:34 -07:00
Patrick Arminio
923d8282c7 Fix duplicated ErrorType declaration (#539)
* Add failing test case

* Fix duplicated ErrorType declaration
2019-03-31 12:01:43 +01:00
Syrus Akbary
54ef52e1c6 Reformatted files using black 2018-07-19 16:52:24 -07:00
Paul Bailey
91a99ee39c serializer update support 2018-02-06 13:37:28 -06:00
Paul Bailey
e05f41af40 fixed indentation 2017-11-12 23:10:29 +00:00
Paul Bailey
e7391937dd fixes #322, fixed incorrect serializer instance usage 2017-11-10 21:49:48 +00:00
Andy Clayton
c130490b4f ensure SerializerMutation.errors is None on success in 2.x
Upon success the result was correct but also included:

"errors": [
  {
    "message": "User Error: expected iterable, but did not find one
for field <SerializerMutation_Subclass>Payload.errors."
  }
]

This seemed to be due to Payload.errors defaulting to graphene.List
rather than unset or None. Unsure what exactly changed with 2.x to break
this, so I welcome a better fix, but explicitly setting errors to None
also seems easy enough.
2017-08-31 12:37:54 -05:00
Andy Clayton
cc58b91e43 fix SerializerMutation regression for 2.x
72529b7 seems to break SerializerMutation by commenting out support for
input fields. As a result input only ever had a clientMutationId field.
2017-08-31 12:21:50 -05:00
Syrus Akbary
3d58148f03 Code adapted to new resolver API 2017-07-28 09:43:27 -07:00
Syrus Akbary
72529b70bb Fixed all tests and flake issues 2017-07-24 23:42:40 -07:00
Syrus Akbary
48bcccdac2 Improved integration with Graphene 2.0 2017-07-24 22:27:50 -07:00
Patrick Arminio
93bbc194bf Add missing new line 2017-06-29 09:59:21 +01:00
Patrick Arminio
5c3306e78d Return empty errors when successful 2017-06-26 18:16:55 +01:00
Patrick Arminio
000ef6c42e Fix result from mutation 2017-06-26 18:03:01 +01:00
Patrick Arminio
c3899248af Use six.with_metaclass to support python 2.7 2017-06-26 09:19:49 +01:00
Patrick Arminio
14bc1cdb92 Add SerializerMutation base class 2017-06-26 09:19:49 +01:00