Merge pull request #1 from nikolabjelo/master

Last minute bugs
This commit is contained in:
nikolabjelo authored and GitHub committed 2019-03-16 16:11:58 +01:00
commit 7e58f01db1
3 files changed
+17 -12

No files matched your search

+7 -1
View File
@@ -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) => {
+7 -8
View File
@@ -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;
},
+3 -3
View File
@@ -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) },
}),
});