Adding the cockpit to the masterApp

This commit is contained in:
Unknown committed 2019-03-19 12:57:41 +01:00
1 parent df20196b2b
commit edcda1a680
2 files changed
+44 -3

No files matched your search

+35 -1
View File
@@ -6,9 +6,43 @@ export const linkSchemaDefs =
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) => ({
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}`,