Skip to content

Commit 161c8d8

Browse files
authored
Merge branch 'fix-graphene-objects' of 'https://github.com/jjmerchante/grimoirelab-sortinghat'
Merges #1017 Closes #1017
2 parents a6c9ccc + b9af815 commit 161c8d8

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: GraphQL task_id type changed and interval value conversion
3+
category: fixed
4+
author: Jose Javier Merchante <[email protected]>
5+
issue: null
6+
notes: >
7+
Updated task_id fields in DeleteScheduledTask and UpdateScheduledTask
8+
to use graphene.ID() instead of graphene.Int(). In Graphene v3, this
9+
caused type errors because a string value was being passed instead of
10+
an integer.
11+
12+
Also converted interval values to numbers in the ImporterModal and
13+
SettingsGeneral components to prevent similar type errors, since
14+
Graphene v3 expects numeric values instead of strings.

sortinghat/core/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ def mutate(self, info, job, interval, params=None):
15501550

15511551
class DeleteScheduledTask(graphene.Mutation):
15521552
class Arguments:
1553-
task_id = graphene.Int()
1553+
task_id = graphene.ID()
15541554

15551555
deleted = graphene.Boolean()
15561556

@@ -1574,7 +1574,7 @@ def mutate(self, info, task_id):
15741574

15751575
class UpdateScheduledTask(graphene.Mutation):
15761576
class Arguments:
1577-
task_id = graphene.Int()
1577+
task_id = graphene.ID()
15781578
data = ScheduledTaskInputType()
15791579

15801580
task = graphene.Field(lambda: ScheduledTaskType)

ui/src/components/ImporterModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default {
123123
});
124124
const response = await this.createTask(
125125
"import_identities",
126-
interval,
126+
Number(interval),
127127
params
128128
);
129129
if (response && !response.errors) {
@@ -145,7 +145,7 @@ export default {
145145
...this.form.fields,
146146
});
147147
const data = {
148-
interval: interval,
148+
interval: Number(interval),
149149
params: params,
150150
};
151151
const response = await this.editTask(this.task.id, data);

ui/src/views/SettingsGeneral.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export default {
331331
const task = await scheduleTask(
332332
this.$apollo,
333333
job,
334-
interval,
334+
Number(interval),
335335
JSON.stringify(this.tasks[job].params)
336336
).catch((error) => {
337337
this.openSnackbar(error);
@@ -367,7 +367,7 @@ export default {
367367
? this.tasks[job].customInterval
368368
: this.tasks[job].interval;
369369
const data = {
370-
interval: interval,
370+
interval: Number(interval),
371371
params: JSON.stringify(this.tasks[job].params),
372372
};
373373

0 commit comments

Comments
 (0)