Skip to content

Commit

Permalink
Fixed bug on GenericType and GenericInputType generations for Queries…
Browse files Browse the repository at this point in the history
… list Type and Mutations.
  • Loading branch information
Ernesto Perez Amigo committed Oct 25, 2017
1 parent 87b9b62 commit d3083b5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ subscription{

## Change Log:

#### v0.1.0-beta1:
1. Fixed bug on GenericType and GenericInputType generations for
Queries list Type and Mutations.

#### v0.1.0-alpha6:
1. Fixed with exclude fields and converter function.

Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ For unsubscribe you must send a graphql subscription request like this:
Change Log:
-----------

**************
v0.1.0-beta1:
**************
1. Fixed bug on GenericType and GenericInputType generations for Queries list Type and Mutations.

**************
v0.1.0-alpha6:
**************
Expand Down
2 changes: 1 addition & 1 deletion graphene_django_extras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .types import DjangoObjectType, DjangoInputObjectType, DjangoListObjectType
from .subscriptions import *

VERSION = (0, 1, 0, 'alpha', '6')
VERSION = (0, 1, 0, 'beta', '1')

__version__ = get_version(VERSION)

Expand Down
8 changes: 6 additions & 2 deletions graphene_django_extras/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def __init_subclass_with_meta__(cls, serializer_class=None, only_fields=(), excl
outputType = registry.get_type_for_model(model)

if not outputType:
outputType = generic_django_object_type_factory(DjangoObjectType, model)
outputType = generic_django_object_type_factory(DjangoObjectType, new_model=model,
new_only_fields=only_fields,
new_exclude_fields=exclude_fields)

django_fields = OrderedDict({output_field_name: Field(outputType)})

Expand All @@ -81,7 +83,9 @@ def __init_subclass_with_meta__(cls, serializer_class=None, only_fields=(), excl
inputType = registry.get_type_for_model(model, for_input=operation)

if not inputType:
inputType = generic_django_input_object_type_factory(DjangoInputObjectType, model,
inputType = generic_django_input_object_type_factory(DjangoInputObjectType, new_model=model,
new_only_fields=only_fields,
new_exclude_fields=exclude_fields,
new_input_for=operation,
new_skip_registry=True,
new_nested_fields=nested_fields)
Expand Down
6 changes: 4 additions & 2 deletions graphene_django_extras/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ def __init_subclass_with_meta__(cls, model=None, results_field_name=None, pagina
baseType = get_global_registry().get_type_for_model(model)

if not baseType:
baseType = generic_django_object_type_factory(DjangoObjectType, model, only_fields,
exclude_fields, filter_fields)
baseType = generic_django_object_type_factory(DjangoObjectType, new_model=model,
new_only_fields=only_fields,
new_exclude_fields=exclude_fields,
new_filter_fields=filter_fields)
filter_fields = filter_fields or baseType._meta.filter_fields
"""
if paginations:
Expand Down

0 comments on commit d3083b5

Please sign in to comment.