pledge4future/WePledge

Create working group endpoint returns error

Closed this issue · 4 comments

When trying to create a working group, the backend returns an error for the mutation query that previously worked.

Mutation name: mutation createWorkingGroup
Request body:

{
    "name": "MockWorkingGroup",
    "institution": "Weihenstephan-Triesdorf University of Applied Sciences",
    "city": "Berlin",
    "country": "Germany",
    "field": "Social Sciences",
    "subField": "Sociology",
    "nEmployees": 20,
    "is_public": true
}

Backend response:

Argument "input" has invalid value {name: $name, institution: $institution, city: $city, country: $country, field: $field, subfield: $subField, nEmployees: $nEmployees, isPublic: $is_public}.
In field "institution": Unknown field.
In field "city": Unknown field.
In field "country": Unknown field.
In field "field": Unknown field.
In field "subfield": Unknown field.
In field "institutionId": Expected "Int!", found null.
In field "researchFieldId": Expected "Int!", found null.

I realised that this is probably due to changes in this commit:

10ad5cb

@redfrexx Why did we change the input for the mutation? Is this doccumented somewhere?

I managed to find a work around in #236

Sorry, forgot to update the documentation on this. As far as I remember we decided to select the institutions and working groups by IDs so it's less ambigous and we have to pass less arguments to the endpoint. I've also implemented this for the research fields, since it's the same issue. Does it now work like this or does the endpoint need to be adapted?

No I think the workaround is fine for now. Closing this :)