private Builder(Argument existing) { this.sourceLocation = existing.getSourceLocation(); this.comments = existing.getComments(); this.name = existing.getName(); this.value = existing.getValue(); this.ignoredChars = existing.getIgnoredChars(); }
@Override public Argument deepCopy() { return new Argument(name, deepCopy(value), getSourceLocation(), getComments(), getIgnoredChars()); }
@Override public void checkArgument(Argument argument) { GraphQLDirective directiveDef = getValidationContext().getDirective(); if (directiveDef != null) { GraphQLArgument directiveArgument = directiveDef.getArgument(argument.getName()); if (directiveArgument == null) { String message = String.format("Unknown directive argument %s", argument.getName()); addError(ValidationErrorType.UnknownDirective, argument.getSourceLocation(), message); } return; } GraphQLFieldDefinition fieldDef = getValidationContext().getFieldDef(); if (fieldDef == null) return; GraphQLArgument fieldArgument = fieldDef.getArgument(argument.getName()); if (fieldArgument == null) { String message = String.format("Unknown field argument %s", argument.getName()); addError(ValidationErrorType.UnknownArgument, argument.getSourceLocation(), message); } } }
@Override public void checkArgument(Argument argument) { GraphQLArgument fieldArgument = getValidationContext().getArgument(); if (fieldArgument == null) return; ArgumentValidationUtil validationUtil = new ArgumentValidationUtil(argument); if (!validationUtil.isValidLiteralValue(argument.getValue(), fieldArgument.getType(), getValidationContext().getSchema())) { addError(ValidationErrorType.WrongType, argument.getSourceLocation(), validationUtil.getMessage()); } } }
private Builder(Argument existing) { this.sourceLocation = existing.getSourceLocation(); this.comments = existing.getComments(); this.name = existing.getName(); this.value = existing.getValue(); this.ignoredChars = existing.getIgnoredChars(); }
@Override public Argument deepCopy() { return new Argument(name, deepCopy(value), getSourceLocation(), getComments(), getIgnoredChars()); }
@Override public void checkArgument(Argument argument) { GraphQLDirective directiveDef = getValidationContext().getDirective(); if (directiveDef != null) { GraphQLArgument directiveArgument = directiveDef.getArgument(argument.getName()); if (directiveArgument == null) { String message = String.format("Unknown directive argument %s", argument.getName()); addError(ValidationErrorType.UnknownDirective, argument.getSourceLocation(), message); } return; } GraphQLFieldDefinition fieldDef = getValidationContext().getFieldDef(); if (fieldDef == null) return; GraphQLArgument fieldArgument = fieldDef.getArgument(argument.getName()); if (fieldArgument == null) { String message = String.format("Unknown field argument %s", argument.getName()); addError(ValidationErrorType.UnknownArgument, argument.getSourceLocation(), message); } } }
@Override public void checkArgument(Argument argument) { GraphQLArgument fieldArgument = getValidationContext().getArgument(); if (fieldArgument == null) return; ArgumentValidationUtil validationUtil = new ArgumentValidationUtil(argument); if (!validationUtil.isValidLiteralValue(argument.getValue(), fieldArgument.getType(), getValidationContext().getSchema())) { addError(ValidationErrorType.WrongType, argument.getSourceLocation(), validationUtil.getMessage()); } } }