10 files changed
+7815
-6422
No files matched your search
Generated
+7598
-6394
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/Algoteers/MasterApp#readme",
|
||||
"devDependencies": {
|
||||
"@advancedalgos/events-client": "0.0.4",
|
||||
"@superalgos/events-client": "0.0.1",
|
||||
"@advancedalgos/financial-beings-client": "0.0.5",
|
||||
"@superalgos/operations-client": "0.0.16",
|
||||
"@babel/core": "^7.1.2",
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import { Layout, Home, Charts, Callback, EmailSignupConfirm } from './views'
|
||||
|
||||
import Users from '@superalgos/users-client'
|
||||
import Teams from '@superalgos/teams-client'
|
||||
import Events from '@advancedalgos/events-client'
|
||||
import Events from '@superalgos/events-client'
|
||||
import KeyVault from '@superalgos/key-vault-client'
|
||||
import FinancialBeings from '@advancedalgos/financial-beings-client'
|
||||
import Operations from '@superalgos/operations-client'
|
||||
|
||||
@@ -66,7 +66,7 @@ const authLink = setContext((_, { headers }) => {
|
||||
}
|
||||
})
|
||||
|
||||
const cache = new InMemoryCache().restore(window.__APOLLO_STATE__)
|
||||
const cache = new InMemoryCache({ addTypename: false }).restore(window.__APOLLO_STATE__)
|
||||
|
||||
const defaultOptions = {
|
||||
watchQuery: {
|
||||
|
||||
@@ -42,10 +42,9 @@ const eventsMenus = {
|
||||
icon: Home,
|
||||
submenus: [
|
||||
{ title: 'Directory', to: '/events', icon: ImportContacts },
|
||||
{ title: 'Your events', to: '/events/my', icon: GamepadRounded, authenticated: true },
|
||||
{ title: 'Your hosted events', to: '/events/host', icon: AccessibilityNew, authenticated: true },
|
||||
{ title: 'Host an event', to: '/events/create', icon: LibraryAdd, authenticated: true },
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/UsersModule/issues/new', icon: BugReport, externalLink: true }
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/EventsClientModule/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -74,20 +73,20 @@ const operationsMenus = {
|
||||
]
|
||||
}
|
||||
|
||||
const financialBeingsMenus = {
|
||||
title: 'FBs',
|
||||
to: '/financial-beings',
|
||||
icon: Home,
|
||||
authenticated: false,
|
||||
submenus: [
|
||||
{ title: 'Directory', to: '/financial-beings', icon: ImportContacts }
|
||||
]
|
||||
}
|
||||
// const financialBeingsMenus = {
|
||||
// title: 'FBs',
|
||||
// to: '/financial-beings',
|
||||
// icon: Home,
|
||||
// authenticated: false,
|
||||
// submenus: [
|
||||
// { title: 'Directory', to: '/financial-beings', icon: ImportContacts }
|
||||
// ]
|
||||
// }
|
||||
|
||||
const allMenus = [
|
||||
usersMenus,
|
||||
teamsMenus,
|
||||
// eventsMenus,
|
||||
eventsMenus,
|
||||
// financialBeingsMenus,
|
||||
keyvaultMenus,
|
||||
operationsMenus
|
||||
|
||||
+9
-5
@@ -8,7 +8,7 @@ import jwksRsa from 'jwks-rsa'
|
||||
import axios from 'axios'
|
||||
|
||||
import { createTransformedRemoteSchema } from './createRemoteSchema'
|
||||
import { teams, events } from './links'
|
||||
import { teams, events, operations } from './links'
|
||||
|
||||
import logger from './logger'
|
||||
|
||||
@@ -76,9 +76,9 @@ async function run () {
|
||||
|
||||
if (transformedTeamsSchema) {
|
||||
schemas.push(transformedTeamsSchema)
|
||||
if (transformedUsersSchema) {
|
||||
if (transformedUsersSchema && transformedEventsSchema) {
|
||||
schemas.push(teams.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, teams.resolver(transformedUsersSchema))
|
||||
resolvers = Object.assign(resolvers, teams.resolver(transformedUsersSchema, transformedEventsSchema))
|
||||
}
|
||||
}
|
||||
if (transformedUsersSchema) {
|
||||
@@ -86,9 +86,9 @@ async function run () {
|
||||
}
|
||||
if (transformedEventsSchema) {
|
||||
schemas.push(transformedEventsSchema)
|
||||
if (transformedUsersSchema && transformedTeamsSchema) {
|
||||
if (transformedUsersSchema && transformedTeamsSchema && transformedOperationsSchema) {
|
||||
schemas.push(events.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, events.resolver(transformedUsersSchema, transformedTeamsSchema))
|
||||
resolvers = Object.assign(resolvers, events.resolver(transformedUsersSchema, transformedTeamsSchema, transformedOperationsSchema))
|
||||
}
|
||||
}
|
||||
if (transformedKeyVaultSchema) {
|
||||
@@ -99,6 +99,10 @@ async function run () {
|
||||
}
|
||||
if (transformedOperationsSchema) {
|
||||
schemas.push(transformedOperationsSchema)
|
||||
if (transformedTeamsSchema) {
|
||||
schemas.push(operations.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, operations.resolver(transformedTeamsSchema))
|
||||
}
|
||||
}
|
||||
if (transformedNotificationsSchema) {
|
||||
schemas.push(transformedNotificationsSchema)
|
||||
|
||||
+126
-6
@@ -3,12 +3,33 @@ 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
|
||||
}
|
||||
extend type events_Formula {
|
||||
owner: users_User
|
||||
}
|
||||
extend type events_Plotter {
|
||||
owner: users_User
|
||||
}
|
||||
extend type events_Participant {
|
||||
team: teams_Team
|
||||
participant: teams_Team
|
||||
}
|
||||
extend type events_Participant {
|
||||
clone: operations_GetClones
|
||||
}
|
||||
extend type events_Invitation {
|
||||
invitee: teams_Team
|
||||
}
|
||||
`
|
||||
|
||||
export const resolver = (usersSchema, teamsSchema) => ({
|
||||
export const resolver = (usersSchema, teamsSchema, operationsSchema) => ({
|
||||
events_Event: {
|
||||
host: {
|
||||
fragment: `fragment UserFragment on events_Event{hostId}`,
|
||||
@@ -22,12 +43,111 @@ export const resolver = (usersSchema, teamsSchema) => ({
|
||||
info
|
||||
})
|
||||
}
|
||||
},
|
||||
participatingAs: {
|
||||
fragment: `fragment TeamFragment on events_Event{participatingAsId}`,
|
||||
resolve ({participatingAsId : teamIds}, args, context, info) {
|
||||
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) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'teams_TeamsByIds',
|
||||
args: { teamIds },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
events_Inviter: {
|
||||
inviter: {
|
||||
fragment: `fragment UserFragment on events_Inviter{inviterId}`,
|
||||
resolve ({inviter : id}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: usersSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'users_User',
|
||||
args: { id },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
events_Formula: {
|
||||
owner: {
|
||||
fragment: `fragment UserFragment on events_Formula{ownerId}`,
|
||||
resolve ({owner : id}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: usersSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'users_User',
|
||||
args: { id },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
events_Plotter: {
|
||||
owner: {
|
||||
fragment: `fragment UserFragment on events_Plotter{ownerId}`,
|
||||
resolve ({owner : id}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: usersSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'users_User',
|
||||
args: { id },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
events_Participant: {
|
||||
team: {
|
||||
fragment: `fragment TeamFragment on events_Participant{teamId}`,
|
||||
resolve ({teamId}, args, context, info) {
|
||||
participant: {
|
||||
fragment: `fragment TeamFragment on events_Participant{participantId}`,
|
||||
resolve ({participantId : teamId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'teams_TeamById',
|
||||
args: { teamId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
},
|
||||
clone: {
|
||||
fragment: `fragment CloneFragment on events_Participant{operationId}`,
|
||||
resolve ({operationId: cloneId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: operationsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'operations_GetClone',
|
||||
args: { cloneId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
events_Invitation: {
|
||||
invitee: {
|
||||
fragment: `fragment TeamFragment on events_Invitation{inviteeId}`,
|
||||
resolve ({inviteeId : teamId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
operation: 'query',
|
||||
@@ -38,7 +158,7 @@ export const resolver = (usersSchema, teamsSchema) => ({
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
export default { resolver, linkSchemaDefs }
|
||||
@@ -1,4 +1,5 @@
|
||||
import teams from './teams'
|
||||
import events from './events'
|
||||
import operations from './operations'
|
||||
|
||||
export { teams, events }
|
||||
export { teams, events, operations }
|
||||
@@ -0,0 +1,42 @@
|
||||
export const linkSchemaDefs =
|
||||
`
|
||||
extend type operations_GetClones {
|
||||
team: teams_Team
|
||||
}
|
||||
extend type operations_GetClones {
|
||||
bot: teams_FinancialBeings
|
||||
}
|
||||
`
|
||||
|
||||
export const resolver = (teamsSchema) => ({
|
||||
operations_GetClones: {
|
||||
team: {
|
||||
fragment: `fragment TeamFragment on operations_GetClones{teamId}`,
|
||||
resolve ({teamId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'teams_TeamById',
|
||||
args: { teamId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
},
|
||||
bot: {
|
||||
fragment: `fragment TeamFragment on operations_GetClones{botId}`,
|
||||
resolve ({botId: fbId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'teams_FbByFbId',
|
||||
args: { fbId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default { resolver, linkSchemaDefs }
|
||||
@@ -3,9 +3,19 @@ export const linkSchemaDefs =
|
||||
extend type teams_Team {
|
||||
ownerUser: users_User
|
||||
}
|
||||
extend type teams_Team {
|
||||
events(
|
||||
hostId: String,
|
||||
inviteeId: String,
|
||||
minStartDate: Int,
|
||||
maxStartDate: Int,
|
||||
minEndDate: Int,
|
||||
maxEndDate: Int
|
||||
): [events_Event]
|
||||
}
|
||||
`
|
||||
|
||||
export const resolver = (usersSchema) => ({
|
||||
export const resolver = (usersSchema, eventsSchema) => ({
|
||||
teams_Team: {
|
||||
ownerUser: {
|
||||
fragment: `fragment UserFragment on teams_Team{owner}`,
|
||||
@@ -19,6 +29,19 @@ export const resolver = (usersSchema) => ({
|
||||
info
|
||||
})
|
||||
}
|
||||
},
|
||||
events: {
|
||||
fragment: `fragment EventFragment on teams_Team{id}`,
|
||||
resolve ({id: participantId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: eventsSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'events_Events',
|
||||
args: { ...args, participantId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user