Merge remote-tracking branch 'upstream/develop' into feature/strategizer
This commit is contained in:
commit
2d87419750
11 files changed
+4567
-745
No files matched your search
Generated
+4238
-679
File diff suppressed because it is too large.
Load diff
+7
-6
@@ -25,19 +25,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/Algoteers/MasterApp#readme",
|
||||
"devDependencies": {
|
||||
"@advancedalgos/events-client": "0.0.4",
|
||||
"@superalgos/logs-client": "0.0.1",
|
||||
"@superalgos/events-client": "0.0.2",
|
||||
"@advancedalgos/financial-beings-client": "0.0.5",
|
||||
"@superalgos/operations-client": "0.0.14",
|
||||
"@superalgos/operations-client": "0.0.20",
|
||||
"@superalgos/key-vault-client": "0.0.31",
|
||||
"@superalgos/teams-client": "0.0.33",
|
||||
"@superalgos/users-client": "0.0.25",
|
||||
"@superalgos/web-components": "0.0.18",
|
||||
"@babel/core": "^7.1.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||
"@babel/plugin-transform-runtime": "^7.1.0",
|
||||
"@babel/preset-env": "^7.1.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@superalgos/key-vault-client": "0.0.28",
|
||||
"@superalgos/teams-client": "0.0.33",
|
||||
"@superalgos/users-client": "0.0.25",
|
||||
"@superalgos/web-components": "0.0.18",
|
||||
"autoprefixer": "^9.2.0",
|
||||
"babel-loader": "^8.0.4",
|
||||
"babel-preset-flow": "6.23.0",
|
||||
|
||||
+10
-3
@@ -16,11 +16,13 @@ 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'
|
||||
import Strategizer from '@superalgos/strategizer-client'
|
||||
import Logs from '@superalgos/logs-client'
|
||||
// import Miners from '@superalgos/miners-client'
|
||||
|
||||
export const auth = new Auth(
|
||||
result => console.log('Authentication successful.'),
|
||||
@@ -75,17 +77,22 @@ export const MasterApp = props => (
|
||||
render={props => <FinancialBeings {...props} auth={auth}/>}
|
||||
/>
|
||||
<Route
|
||||
path='/key-vault'
|
||||
path='/keys'
|
||||
render={props => <KeyVault {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/operations'
|
||||
path='/clones'
|
||||
render={props => <Operations {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/strategizer'
|
||||
render={props => <Strategizer {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/logs'
|
||||
render={props => <Logs {...props} auth={auth} />}
|
||||
/>
|
||||
|
||||
</Switch>
|
||||
</Layout>
|
||||
</MuiThemeProvider>
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
BugReport,
|
||||
People,
|
||||
Group,
|
||||
// Adb,
|
||||
VpnKey,
|
||||
Home,
|
||||
AddCircleOutline,
|
||||
@@ -44,48 +43,57 @@ 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 }
|
||||
]
|
||||
}
|
||||
|
||||
const keyvaultMenus = {
|
||||
title: 'Key Vault',
|
||||
to: '/key-vault',
|
||||
title: 'Keys',
|
||||
to: '/keys',
|
||||
icon: Home,
|
||||
authenticated: true,
|
||||
submenus: [
|
||||
{ title: 'Your keys', to: '/key-vault/browse', icon: VpnKey },
|
||||
{ title: 'Add key', to: '/key-vault/addKey', icon: AddCircleOutline },
|
||||
{ title: 'Your keys', to: '/keys/browse', icon: VpnKey },
|
||||
{ title: 'Add key', to: '/keys/addKey', icon: AddCircleOutline },
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/KeyVaultModule/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
const operationsMenus = {
|
||||
title: 'Operations',
|
||||
to: '/operations',
|
||||
title: 'Clones',
|
||||
to: '/clones',
|
||||
icon: Home,
|
||||
authenticated: true,
|
||||
submenus: [
|
||||
{ title: 'Active clones', to: '/operations/browse', icon: ImportContacts },
|
||||
{ title: 'History', to: '/operations/history', icon: LibraryAdd },
|
||||
{ title: 'Clone a bot', to: '/operations/add', icon: AddCircleOutline },
|
||||
{ title: 'Active Clones', to: '/clones/browse', icon: ImportContacts },
|
||||
{ title: 'History Clones', to: '/clones/history', icon: LibraryAdd },
|
||||
{ title: 'Create Clone', to: '/clones/add', icon: AddCircleOutline },
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/OperationsModule/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
const financialBeingsMenus = {
|
||||
title: 'FBs',
|
||||
to: '/financial-beings',
|
||||
const minersMenus = {
|
||||
title: 'Miners',
|
||||
to: '/miners',
|
||||
icon: Home,
|
||||
authenticated: false,
|
||||
submenus: [
|
||||
{ title: 'Directory', to: '/financial-beings', icon: ImportContacts }
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/minersClient/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
// const financialBeingsMenus = {
|
||||
// title: 'FBs',
|
||||
// to: '/financial-beings',
|
||||
// icon: Home,
|
||||
// authenticated: false,
|
||||
// submenus: [
|
||||
// { title: 'Directory', to: '/financial-beings', icon: ImportContacts }
|
||||
// ]
|
||||
// }
|
||||
|
||||
const strategizerMenus = {
|
||||
title: 'Strategizer',
|
||||
to: '/strategizer',
|
||||
@@ -100,10 +108,11 @@ const strategizerMenus = {
|
||||
const allMenus = [
|
||||
usersMenus,
|
||||
teamsMenus,
|
||||
// eventsMenus,
|
||||
eventsMenus,
|
||||
// financialBeingsMenus,
|
||||
keyvaultMenus,
|
||||
operationsMenus,
|
||||
minersMenus,
|
||||
strategizerMenus
|
||||
]
|
||||
|
||||
|
||||
@@ -18,7 +18,9 @@ module.exports = merge(commonConfig, {
|
||||
},
|
||||
|
||||
devServer: {
|
||||
historyApiFallback: true
|
||||
historyApiFallback: {
|
||||
disableDotRule: true
|
||||
}
|
||||
},
|
||||
|
||||
plugins: [
|
||||
|
||||
+36
-30
@@ -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'
|
||||
|
||||
@@ -70,15 +70,31 @@ async function run () {
|
||||
'notifications_',
|
||||
process.env.NOTIFICATIONS_API_URL,
|
||||
process.env.NOTIFICATIONS_API_PRESHARED)
|
||||
const transformedLogsSchema = await createTransformedRemoteSchema(
|
||||
'logs_',
|
||||
process.env.LOGS_API_URL,
|
||||
process.env.LOGS_API_PRESHARED)
|
||||
// const transformedMinersSchema = await createTransformedRemoteSchema(
|
||||
// 'miners_',
|
||||
// process.env.MINERS_API_URL,
|
||||
// process.env.MINERS_PRESHARED)
|
||||
const transformeStrategizerSchema = await createTransformedRemoteSchema(
|
||||
'strategizer_',
|
||||
process.env.STRATEGIZER_API_URL,
|
||||
process.env.STRATEGIZER_API_PRESHARED)
|
||||
const transformeCockpitSchema = await createTransformedRemoteSchema(
|
||||
'cockpit_',
|
||||
process.env.COCKPIT_API_URL,
|
||||
process.env.COCKPIT_API_PRESHARED)
|
||||
|
||||
var schemas = []
|
||||
var resolvers = {}
|
||||
|
||||
if (transformedTeamsSchema) {
|
||||
schemas.push(transformedTeamsSchema)
|
||||
if (transformedUsersSchema) {
|
||||
if (transformedUsersSchema && transformedEventsSchema && transformeStrategizerSchema) {
|
||||
schemas.push(teams.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, teams.resolver(transformedUsersSchema))
|
||||
resolvers = Object.assign(resolvers, teams.resolver(transformedUsersSchema, transformedEventsSchema, transformeStrategizerSchema))
|
||||
}
|
||||
}
|
||||
if (transformedUsersSchema) {
|
||||
@@ -86,9 +102,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,10 +115,23 @@ async function run () {
|
||||
}
|
||||
if (transformedOperationsSchema) {
|
||||
schemas.push(transformedOperationsSchema)
|
||||
if (transformedTeamsSchema && transformeCockpitSchema) {
|
||||
schemas.push(operations.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, operations.resolver(transformedTeamsSchema, transformeCockpitSchema))
|
||||
}
|
||||
}
|
||||
if (transformedNotificationsSchema) {
|
||||
schemas.push(transformedNotificationsSchema)
|
||||
}
|
||||
if (transformedLogsSchema) {
|
||||
schemas.push(transformedLogsSchema)
|
||||
}
|
||||
if (transformeStrategizerSchema) {
|
||||
schemas.push(transformeStrategizerSchema)
|
||||
}
|
||||
if (transformeCockpitSchema) {
|
||||
schemas.push(transformeCockpitSchema)
|
||||
}
|
||||
|
||||
const schema = mergeSchemas({
|
||||
schemas,
|
||||
@@ -166,8 +195,8 @@ async function run () {
|
||||
schema,
|
||||
context,
|
||||
formatError: error => {
|
||||
logger.error(`An error ocurred inside a module: ${JSON.stringify(error)}`)
|
||||
return error
|
||||
logger.error('An error ocurred inside a module: %s', error.message)
|
||||
return error.message
|
||||
},
|
||||
formatResponse: response => {
|
||||
logger.debug('Response from Apollo Server: ' + response)
|
||||
@@ -181,29 +210,6 @@ async function run () {
|
||||
}
|
||||
})
|
||||
|
||||
const whitelist = [
|
||||
process.env.PROJECT_SITE_URL,
|
||||
process.env.PLATFORM_URL,
|
||||
process.env.GRAPHQL_API_URL,
|
||||
process.env.TEAMS_API_URL,
|
||||
process.env.USERS_API_URL,
|
||||
process.env.EVENTS_API_URL,
|
||||
process.env.KEYVAULT_API_URL,
|
||||
process.env.FINANCIAL_BEINGS_API_URL,
|
||||
process.env.NOTIFICATIONS_API_URL
|
||||
]
|
||||
|
||||
const corsOptionsDelegate = (req, callback) => {
|
||||
let corsOptions
|
||||
if (whitelist.indexOf(req.header('Origin')) !== -1) {
|
||||
corsOptions = { origin: true, credentials: true }
|
||||
} else {
|
||||
corsOptions = { origin: false, credentials: true }
|
||||
}
|
||||
callback(null, corsOptions)
|
||||
}
|
||||
|
||||
// server.applyMiddleware({ app, cors: corsOptionsDelegate })
|
||||
server.applyMiddleware({ app, cors: { origin: true, credentials: true, methods:'GET,PUT,POST,DELETE,OPTIONS'}})
|
||||
|
||||
app.listen(4100)
|
||||
|
||||
+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,76 @@
|
||||
export const linkSchemaDefs =
|
||||
`
|
||||
extend type operations_GetClones {
|
||||
team: teams_Team
|
||||
}
|
||||
extend type operations_GetClones {
|
||||
bot: teams_FinancialBeings
|
||||
}
|
||||
extend type operations_Clone {
|
||||
orders( state: cockpit_OrderStateEnum ): [cockpit_Order]
|
||||
}
|
||||
extend type operations_Clone {
|
||||
signals( state: cockpit_SignalStateEnum ): [cockpit_Signal]
|
||||
}
|
||||
`
|
||||
|
||||
export const resolver = (teamsSchema, cockpitSchema) => ({
|
||||
operations_Clone: {
|
||||
orders: {
|
||||
fragment: `fragment OrderFragment on operations_Clone{id}`,
|
||||
resolve ({id: cloneId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: cockpitSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'cockpit_OrdersByClondeId',
|
||||
args: { ...args, cloneId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
},
|
||||
signals: {
|
||||
fragment: `fragment SignalFragment on operations_Clone{id}`,
|
||||
resolve ({id: cloneId}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: cockpitSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'cockpit_SignalsByClondeId',
|
||||
args: { ...args, cloneId },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
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,37 @@ 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]
|
||||
}
|
||||
extend type teams_FinancialBeings {
|
||||
strategy: strategizer_Strategy
|
||||
}
|
||||
`
|
||||
|
||||
export const resolver = (usersSchema) => ({
|
||||
export const resolver = (usersSchema, eventsSchema, strategizerSchema) => ({
|
||||
teams_FinancialBeings: {
|
||||
strategy: {
|
||||
fragment: `fragment StrategyFragment on teams_FinancialBeings{slug}`,
|
||||
resolve ({slug: fbSlug}, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: strategizerSchema,
|
||||
operation: 'query',
|
||||
fieldName: 'strategizer_StrategyByFb',
|
||||
args: { fbSlug },
|
||||
context,
|
||||
info
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
teams_Team: {
|
||||
ownerUser: {
|
||||
fragment: `fragment UserFragment on teams_Team{owner}`,
|
||||
@@ -19,6 +47,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