Links for canParticipateAs and participating as

This commit is contained in:
Unknown committed 2019-02-18 12:21:50 +01:00
1 parent 04bff5afa3
commit c57fad1aaf
1 file changed
+34
+34
View File
@@ -3,6 +3,12 @@ export const linkSchemaDefs =
extend type events_Event {
host: users_User
}
extend type events_Event {
participatingAs: [teams_Team]
}
extend type events_Event {
canParticipateAs: [teams_Team]
}
extend type events_Inviter {
inviter: users_User
}
@@ -37,6 +43,34 @@ export const resolver = (usersSchema, teamsSchema, operationsSchema) => ({
info
})
}
},
participatingAs: {
fragment: `fragment TeamFragment on events_Event{participatingAsId}`,
resolve ({participatingAsId : teamIds}, args, context, info) {
console.log(teamIds)
return info.mergeInfo.delegateToSchema({
schema: teamsSchema,
operation: 'query',
fieldName: 'teams_TeamsByIds',
args: { teamIds },
context,
info
})
}
},
canParticipateAs: {
fragment: `fragment TeamFragment on events_Event{canParticipateAsId}`,
resolve ({canParticipateAsId : teamIds}, args, context, info) {
console.log(teamIds)
return info.mergeInfo.delegateToSchema({
schema: teamsSchema,
operation: 'query',
fieldName: 'teams_TeamsByIds',
args: { teamIds },
context,
info
})
}
}
},
events_Inviter: {