-
Notifications
You must be signed in to change notification settings - Fork 2
Backend: Working Group Management
Christina Ludwig edited this page Feb 28, 2023
·
9 revisions
After a user has registered they can/should join a working group, for which there are three scenarios:
If the user's working group already exist, they can choose it by selecting the country, city, institution (e.g. Heidelberg University) and the working group's name from several dropdown menus. Valid countries, cities and institutions can be queried using the institutions endpoint, existing working groups using the workinggroups endpoint. The selected working can be sent to backend using the requestJoinWorkingGroup endpint.
If the user's working group does not exists yet, they can create it by providing
- the working group's name
- the institution (incl. country and city) it belongs to (from predefined selection)
- research field (from predefined selection)
- number of employees.
query {
workinggroups {
id
name
field {
field
subfield
}
}
}
query {
institutions {
id
name
city
country
}
}
query {
researchfields {
id
field
subfield
}
}
mutation ($id: String!){
setWorkingGroup (input: {
id: $id
}) {
user {
username
workingGroup {
name
}
}
}
}
needs user token in header
mutation {
mutation ($name: String!, $institution_id: Int!, $research_field_id: Int!, $nemployees: Int!, $is_public: Boolean!){
createWorkingGroup (input: {
name: $name
institutionId: $institution_id
researchFieldId: $research_field_id
nEmployees: $nemployees
isPublic: $is_public
}) {
ok
workinggroup {
name
representative {
username
}
}
}
}
needs user token in header
mutation ($id: String!){
requestJoinWorkingGroup (input: {
workinggroupId: $id
}
) {
success
joinRequest {
status
id
workingGroup {
id
}
}
}
}
needs user token in header
mutation ($requestId: String!, $approve: Boolean!){
answerJoinRequest (input: {
approve: $approve
requestId: $requestId
}
) {
success
requestingUser {
workingGroup {
id
}
}
}
}