3 files changed
+17
-12
No files matched your search
@@ -1,12 +1,18 @@
|
||||
import {
|
||||
GraphQLNonNull,
|
||||
GraphQLString,
|
||||
} from 'graphql';
|
||||
import { StrategyType } from '../types';
|
||||
import { Strategy } from '../../models';
|
||||
import { StrategyInputType } from '../types/input';
|
||||
|
||||
export const args = {
|
||||
fbId: { type: new GraphQLNonNull(GraphQLString) },
|
||||
strategy: { type: StrategyInputType },
|
||||
};
|
||||
|
||||
const resolve = (parent, { strategy }) => {
|
||||
const resolve = (parent, { fbId, strategy }) => {
|
||||
strategy.fbId = fbId;
|
||||
const newStrategy = new Strategy(strategy);
|
||||
|
||||
return new Promise((res, rej) => {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
GraphQLObjectType,
|
||||
GraphQLString,
|
||||
GraphQLList,
|
||||
} from 'graphql';
|
||||
import {
|
||||
EntryPointType,
|
||||
@@ -19,43 +18,43 @@ const Type = new GraphQLObjectType({
|
||||
fields: () => ({
|
||||
name: { type: GraphQLString },
|
||||
entryPoint: {
|
||||
type: new GraphQLList(EntryPointType),
|
||||
type: EntryPointType,
|
||||
resolve(parent) {
|
||||
return parent.entryPoint;
|
||||
},
|
||||
},
|
||||
exitPoint: {
|
||||
type: new GraphQLList(ExitPointType),
|
||||
type: ExitPointType,
|
||||
resolve(parent) {
|
||||
return parent.exitPoint;
|
||||
},
|
||||
},
|
||||
sellPoint: {
|
||||
type: new GraphQLList(SellPointType),
|
||||
type: SellPointType,
|
||||
resolve(parent) {
|
||||
return parent.sellPoint;
|
||||
},
|
||||
},
|
||||
buyPoint: {
|
||||
type: new GraphQLList(BuyPointType),
|
||||
type: BuyPointType,
|
||||
resolve(parent) {
|
||||
return parent.buyPoint;
|
||||
},
|
||||
},
|
||||
stopLoss: {
|
||||
type: new GraphQLList(StopLossType),
|
||||
type: StopLossType,
|
||||
resolve(parent) {
|
||||
return parent.stopLoss;
|
||||
},
|
||||
},
|
||||
buyOrder: {
|
||||
type: new GraphQLList(BuyOrderType),
|
||||
type: BuyOrderType,
|
||||
resolve(parent) {
|
||||
return parent.buyOrder;
|
||||
},
|
||||
},
|
||||
sellOrder: {
|
||||
type: new GraphQLList(SellOrderType),
|
||||
type: SellOrderType,
|
||||
resolve(parent) {
|
||||
return parent.sellOrder;
|
||||
},
|
||||
|
||||
@@ -44,7 +44,7 @@ const StopLossInputType = new GraphQLInputObjectType({
|
||||
name: 'StopLossTypeInput',
|
||||
description: 'Payload for stopLossType input',
|
||||
fields: () => ({
|
||||
situations: { type: new GraphQLList(PhaseInputType) },
|
||||
phases: { type: new GraphQLList(PhaseInputType) },
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -52,7 +52,7 @@ const BuyOrderInputType = new GraphQLInputObjectType({
|
||||
name: 'BuyOrderTypeInput',
|
||||
description: 'Payload for buyOrderType input',
|
||||
fields: () => ({
|
||||
situations: { type: new GraphQLList(PhaseInputType) },
|
||||
phases: { type: new GraphQLList(PhaseInputType) },
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ const SellOrderInputType = new GraphQLInputObjectType({
|
||||
name: 'SellOrderTypeInput',
|
||||
description: 'Payload for sellOrderType input',
|
||||
fields: () => ({
|
||||
situations: { type: new GraphQLList(PhaseInputType) },
|
||||
phases: { type: new GraphQLList(PhaseInputType) },
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user