Cleaning up a bit of the backend while we are at it (to stop errors)
This commit is contained in:
1 parent
c6b1892187
commit
cb6236a3b7
2 files changed
+7
-8
No files matched your search
@@ -12,12 +12,12 @@ export const resolver = (usersSchema, teamsSchema) => ({
|
||||
events_Event: {
|
||||
host: {
|
||||
fragment: `fragment UserFragment on events_Event{hostId}`,
|
||||
resolve (parent, args, context, info) {
|
||||
resolve ({hostId : id}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: usersSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'users_User',
|
||||
args: { id: parent.hostId },
|
||||
args: { id },
|
||||
context,
|
||||
info
|
||||
})
|
||||
@@ -27,12 +27,12 @@ export const resolver = (usersSchema, teamsSchema) => ({
|
||||
events_Participant: {
|
||||
team: {
|
||||
fragment: `fragment TeamFragment on events_Participant{teamId}`,
|
||||
resolve (parent, args, context, info) {
|
||||
resolve ({teamId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'teams_TeamById',
|
||||
args: { teamId: parent.teamId },
|
||||
args: { teamId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
|
||||
@@ -9,13 +9,12 @@ export const resolver = (usersSchema) => ({
|
||||
teams_Team: {
|
||||
ownerUser: {
|
||||
fragment: `fragment UserFragment on teams_Team{owner}`,
|
||||
resolve (parent, args, context, info) {
|
||||
const authId = parent.owner
|
||||
resolve ({owner: id}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: usersSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'users_UserByAuthId',
|
||||
args: { authId },
|
||||
fieldName: 'users_User',
|
||||
args: { id },
|
||||
context,
|
||||
info
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user