Adding the input types

This commit is contained in:
Unknown committed 2019-03-16 12:19:23 +01:00
1 parent b47bf2016b
commit a17032c571
9 files changed
+89 -70

No files matched your search

@@ -1,14 +1,14 @@
import {
GraphQLNonNull,
GraphQLString,
GraphQLInputObjectType,
} from 'graphql';
const Type = new GraphQLInputObjectType({
name: 'FormulaInput',
description: 'Payload for formula input',
name: 'ConditionInput',
description: 'Payload for condition input',
fields: () => ({
name: { type: new GraphQLNonNull(GraphQLString) },
name: { type: GraphQLString },
code: { type: GraphQLString },
}),
});
+18
View File
@@ -0,0 +1,18 @@
import {
GraphQLString,
GraphQLInputObjectType,
GraphQLList,
} from 'graphql';
import InputSituationType from './Situation';
const Type = new GraphQLInputObjectType({
name: 'PhaseInput',
description: 'Payload for phase input',
fields: () => ({
name: { type: GraphQLString },
code: { type: GraphQLString },
situations: { type: new GraphQLList(InputSituationType) },
}),
});
export default Type;
-15
View File
@@ -1,15 +0,0 @@
import {
GraphQLNonNull,
GraphQLString,
GraphQLInputObjectType,
} from 'graphql';
const Type = new GraphQLInputObjectType({
name: 'PlotterInput',
description: 'Payload for plotter input',
fields: () => ({
name: { type: new GraphQLNonNull(GraphQLString) },
}),
});
export default Type;
-21
View File
@@ -1,21 +0,0 @@
import {
GraphQLInputObjectType,
GraphQLList,
GraphQLInt,
GraphQLNonNull,
} from 'graphql';
import InputSubPrizeType from './SubPrize';
const Type = new GraphQLInputObjectType({
name: 'PrizeInput',
description: 'Payload for formula input',
fields: () => ({
rank: { type: new GraphQLNonNull(GraphQLInt) },
amount: { type: new GraphQLNonNull(GraphQLInt) },
subPrize: {
type: new GraphQLList(InputSubPrizeType),
},
}),
});
export default Type;
+17
View File
@@ -0,0 +1,17 @@
import {
GraphQLString,
GraphQLInputObjectType,
GraphQLList,
} from 'graphql';
import InputConditionType from './Condition';
const Type = new GraphQLInputObjectType({
name: 'SituationInput',
description: 'Payload for situation input',
fields: () => ({
name: { type: GraphQLString },
conditions: { type: new GraphQLList(InputConditionType) },
}),
});
export default Type;
@@ -1,18 +1,14 @@
import {
GraphQLString,
GraphQLInputObjectType,
GraphQLList,
} from 'graphql';
import InputPrizeType from './Prize';
import SubStrategyType from './SubStrategy';
const Type = new GraphQLInputObjectType({
name: 'EventInput',
description: 'Payload for event input',
fields: () => ({
name: { type: GraphQLString },
formulaId: { type: GraphQLString },
plotterId: { type: GraphQLString },
prizes: { type: new GraphQLList(InputPrizeType) },
subStrategies: { type: new GraphQLList(SubStrategyType) },
}),
});
-14
View File
@@ -1,14 +0,0 @@
import {
GraphQLInputObjectType,
GraphQLString,
} from 'graphql';
const Type = new GraphQLInputObjectType({
name: 'SubPrizeInput',
description: 'Payload prize input',
fields: () => ({
condition: { type: GraphQLString },
}),
});
export default Type;
+38
View File
@@ -0,0 +1,38 @@
import {
GraphQLString,
GraphQLInputObjectType,
GraphQLList,
} from 'graphql';
import InputSituationType from './Situation';
import InputPhaseType from './Phase';
const Type = new GraphQLInputObjectType({
name: 'SubStrategyInput',
description: 'Payload for subStrategy input',
fields: () => ({
name: { type: GraphQLString },
entryPoint: {
situations: { type: new GraphQLList(InputSituationType) },
},
exitPoint: {
situations: { type: new GraphQLList(InputSituationType) },
},
sellPoint: {
situations: { type: new GraphQLList(InputSituationType) },
},
buyPoint: {
situations: { type: new GraphQLList(InputSituationType) },
},
stopLoss: {
phases: { type: new GraphQLList(InputPhaseType) },
},
buyOrder: {
phases: { type: new GraphQLList(InputPhaseType) },
},
sellOrder: {
phases: { type: new GraphQLList(InputPhaseType) },
},
}),
});
export default Type;
+10 -10
View File
@@ -1,13 +1,13 @@
import PlotterInputType from './Plotter';
import PrizeInputType from './Prize';
import FormulaInputType from './Formula';
import EventInputType from './Event';
import SubPrizeInputType from './SubPrize';
import StrategyInputType from './Strategy';
import SubStrategyInputType from './SubStrategy';
import ConditionInputType from './Condition';
import SituationInputType from './Situation';
import PhaseInputType from './Phase';
export {
PlotterInputType,
PrizeInputType,
FormulaInputType,
EventInputType,
SubPrizeInputType,
StrategyInputType,
SubStrategyInputType,
ConditionInputType,
SituationInputType,
PhaseInputType,
};