Skip to content

Commit

Permalink
chore(deps): update graphene-django
Browse files Browse the repository at this point in the history
Update to graphene-django 2.12.1 and fix connection field, schema.
  • Loading branch information
Stefan Borer committed Aug 5, 2020
1 parent a5acc5f commit ddbc13e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
5 changes: 4 additions & 1 deletion caluma/caluma_core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ class DjangoConnectionField(DjangoConnectionField):
This can be removed, when (or better if)
https://github.com/graphql-python/graphql-relay-py/issues/12
is resolved.
TODO: properly implement max_limit, see
https://github.com/graphql-python/graphene-django/blob/b552dcac24364d3ef824f865ba419c74605942b2/graphene_django/fields.py#L133
"""

@classmethod
def resolve_connection(cls, connection, args, iterable):
def resolve_connection(cls, connection, args, iterable, max_limit=None):
iterable = maybe_queryset(iterable)
if isinstance(iterable, QuerySet):
# only query count on database when pagination is needed
Expand Down
3 changes: 3 additions & 0 deletions caluma/caluma_form/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,9 @@ class Meta:


class SaveDocument(Mutation):
class Input:
id = graphene.ID()

class Meta:
serializer_class = serializers.DocumentSerializer
model_operations = ["create", "update"]
Expand Down
3 changes: 3 additions & 0 deletions caluma/caluma_workflow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ class Meta:


class SaveCase(Mutation):
class Input:
id = graphene.ID()

class Meta:
serializer_class = serializers.SaveCaseSerializer
model_operations = ["create", "update"]
Expand Down
11 changes: 5 additions & 6 deletions caluma/tests/__snapshots__/test_schema.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@
}

input SaveCaseInput {
id: String
id: ID
workflow: ID!
meta: JSONString
parentWorkItem: ID
Expand Down Expand Up @@ -1395,7 +1395,6 @@
document: ID!
meta: JSONString
value: String
valueId: ID
clientMutationId: String
}

Expand All @@ -1418,7 +1417,7 @@
}

input SaveDocumentInput {
id: String
id: ID
form: ID!
meta: JSONString
clientMutationId: String
Expand Down Expand Up @@ -2134,9 +2133,9 @@
task: Task!
status: WorkItemStatus!
meta: GenericScalar
addressedGroups: [String]!
controllingGroups: [String]!
assignedUsers: [String]!
addressedGroups: [String!]!
controllingGroups: [String!]!
assignedUsers: [String!]!
case: Case!
childCase: Case
document: Document
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ django-localized-fields==5.4.2
django-postgres-extra==1.22
djangorestframework==3.11.0
django_simple_history==2.11.0
graphene-django==2.8.2
graphene-django==2.12.1
idna==2.10
minio==5.0.10
psycopg2-binary==2.8.5
Expand Down

0 comments on commit ddbc13e

Please sign in to comment.