FieldAndArgError(String message, Field field, ExecutionPath path) { this.message = message; this.locations = field == null ? null : Collections.singletonList(field.getSourceLocation()); this.path = path == null ? null : path.toList(); }
/** * Creating absolute paths follows the following logic: * Relative path is null -> Absolute path null * Relative path is empty -> Absolute paths is path up to the field. * Relative path is not empty -> Absolute paths [base Path, relative Path] * * * @return List of paths from the root. */ private List<Object> createAbsolutePath(ExecutionPath executionPath, GraphQLError relativeError) { return Optional.ofNullable(relativeError.getPath()) .map(originalPath -> { List<Object> path = new ArrayList<>(); path.addAll(executionPath.toList()); path.addAll(relativeError.getPath()); return path; }) .map(Collections::unmodifiableList) .orElse(null); }
public NonNullableFieldWasNullError(NonNullableFieldWasNullException exception) { this.message = exception.getMessage(); this.path = exception.getPath().toList(); }
public SerializationError(ExecutionPath path, CoercingSerializeException exception) { this.path = assertNotNull(path).toList(); this.exception = assertNotNull(exception); this.message = mkMessage(path, exception); }
public ExceptionWhileDataFetching(ExecutionPath path, Throwable exception, SourceLocation sourceLocation) { this.path = assertNotNull(path).toList(); this.exception = assertNotNull(exception); this.locations = Collections.singletonList(sourceLocation); this.extensions = mkExtensions(exception); this.message = mkMessage(path, exception); }
public TypeMismatchError(ExecutionPath path, GraphQLType expectedType) { this.path = assertNotNull(path).toList(); this.expectedType = assertNotNull(expectedType); this.message = mkMessage(path, expectedType); }
fetchMap.put("path", executionStepInfo.getPath().toList()); fetchMap.put("parentType", executionStepInfo.getParent().getUnwrappedNonNullType().getName()); fetchMap.put("returnType", executionStepInfo.simplePrint());
public UnresolvedTypeError(ExecutionPath path, ExecutionStepInfo info, UnresolvedTypeException exception) { this.path = assertNotNull(path).toList(); this.exception = assertNotNull(exception); this.message = mkMessage(path, exception, assertNotNull(info)); }
FieldAndArgError(String message, Field field, ExecutionPath path) { this.message = message; this.locations = field == null ? null : Collections.singletonList(field.getSourceLocation()); this.path = path == null ? null : path.toList(); }
public GraphqlErrorBuilder path(ExecutionPath path) { this.path = assertNotNull(path).toList(); return this; }
/** * Creating absolute paths follows the following logic: * Relative path is null -> Absolute path null * Relative path is empty -> Absolute paths is path up to the field. * Relative path is not empty -> Absolute paths [base Path, relative Path] * * * @return List of paths from the root. */ private List<Object> createAbsolutePath(ExecutionPath executionPath, GraphQLError relativeError) { return Optional.ofNullable(relativeError.getPath()) .map(originalPath -> { List<Object> path = new ArrayList<>(); path.addAll(executionPath.toList()); path.addAll(relativeError.getPath()); return path; }) .map(Collections::unmodifiableList) .orElse(null); }
public NonNullableFieldWasNullError(NonNullableFieldWasNullException exception) { this.message = exception.getMessage(); this.path = exception.getPath().toList(); }
public TypeMismatchError(ExecutionPath path, GraphQLType expectedType) { this.path = assertNotNull(path).toList(); this.expectedType = assertNotNull(expectedType); this.message = mkMessage(path, expectedType); }
public ExceptionWhileDataFetching(ExecutionPath path, Throwable exception, SourceLocation sourceLocation) { this.path = assertNotNull(path).toList(); this.exception = assertNotNull(exception); this.locations = Collections.singletonList(sourceLocation); this.extensions = mkExtensions(exception); this.message = mkMessage(path, exception); }
public SerializationError(ExecutionPath path, CoercingSerializeException exception) { this.path = assertNotNull(path).toList(); this.exception = assertNotNull(exception); this.message = mkMessage(path, exception); }
fetchMap.put("path", executionStepInfo.getPath().toList()); fetchMap.put("parentType", executionStepInfo.getParent().getUnwrappedNonNullType().getName()); fetchMap.put("returnType", executionStepInfo.simplePrint());
public UnresolvedTypeError(ExecutionPath path, ExecutionStepInfo info, UnresolvedTypeException exception) { this.path = assertNotNull(path).toList(); this.exception = assertNotNull(exception); this.message = mkMessage(path, exception, assertNotNull(info)); }