Created
April 24, 2018 15:20
-
-
Save olegkalyta/24a30e16c0f1b2f58fe254bcb05da068 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SingleRule = new GraphQLObjectType({ | |
name: 'SingleRule', | |
description: 'Single validation rule', | |
fields: () => ({ | |
id: { | |
type: GraphQLID, | |
description: 'ID of rule' | |
}, | |
fieldName: { | |
type: GraphQLString, | |
description: 'Field that should be validated' | |
}, | |
validationType: { | |
type: RuleType | |
}, | |
rules: new GraphQLList(SingleRule) | |
}), | |
}) | |
const Rules = new GraphQLObjectType({ | |
name: 'RuleTypeSchema', | |
description: 'Validation Rule Type', | |
fields: { | |
rules: { | |
type: new GraphQLList(SingleRule), | |
resolve: () => { | |
return [ | |
{ | |
fieldName: 'firstName', | |
validationType: 'all', | |
rules: [], | |
} | |
] | |
} | |
}, | |
} | |
}) |
Author
olegkalyta
commented
Apr 24, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment