This file contains hidden or 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
| @Service | |
| public class GraphQLRuleService { | |
| // fetches messages from appropriate .prop file | |
| @Autowired | |
| private final MessagesService messagesService; | |
| public RuleSingle stringNonBlank(final String argumentName, final String fieldName) { | |
| return new RuleSingle() { | |
| @Override | |
| public Optional<GraphQLError> applySingle(FieldAndArguments fieldAndArguments, FieldValidationEnvironment environment) { |
This file contains hidden or 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
| // Rule.java | |
| public abstract class Rule | |
| implements BiFunction<FieldAndArguments, FieldValidationEnvironment, Optional<Collection<GraphQLError>>> { | |
| } | |
| // RuleSingle.java | |
| public abstract class RuleSingle extends Rule { | |
| @Override | |
| public final Optional<Collection<GraphQLError>> apply(FieldAndArguments fieldAndArguments, |
This file contains hidden or 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
| @Configuration | |
| @EnableWebSecurity | |
| @EnableGlobalMethodSecurity(prePostEnabled = true) | |
| public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | |
| // ... | |
| } |
NewerOlder