@Override
  public void checkDirective(Directive directive) {
    GraphQLDirective graphQLDirective = getValidationContext().getDirective();
    if (graphQLDirective == null) return;
    Map<String, Argument> argumentMap = argumentMap(directive.getArguments());

    for (GraphQLArgument graphQLArgument : graphQLDirective.getArguments()) {
      Argument argument = argumentMap.get(graphQLArgument.getName());
      if (argument == null && (graphQLArgument.getType() instanceof GraphQLNonNull)) {
        addError(new ValidationError(ValidationErrorType.MissingDirectiveArgument));
      }
    }
  }
  @Override
  public void checkField(Field field) {
    GraphQLFieldDefinition fieldDef = getValidationContext().getFieldDef();
    if (fieldDef == null) return;
    Map<String, Argument> argumentMap = argumentMap(field.getArguments());

    for (GraphQLArgument graphQLArgument : fieldDef.getArguments()) {
      Argument argument = argumentMap.get(graphQLArgument.getName());
      if (argument == null && (graphQLArgument.getType() instanceof GraphQLNonNull)) {
        addError(new ValidationError(ValidationErrorType.MissingFieldArgument));
      }
    }
  }