protected void assertNonNullFieldPrecondition(NonNullableFieldWasNullException e, CompletableFuture<?> completableFuture) throws NonNullableFieldWasNullException { ExecutionStepInfo executionStepInfo = e.getExecutionStepInfo(); if (executionStepInfo.hasParent() && executionStepInfo.getParent().isNonNullType()) { completableFuture.completeExceptionally(new NonNullableFieldWasNullException(e)); } }
/** * See (http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability), * <p> * If a non nullable child field type actually resolves to a null value and the parent type is nullable * then the parent must in fact become null * so we use exceptions to indicate this special case. However if the parent is in fact a non nullable type * itself then we need to bubble that upwards again until we get to the root in which case the result * is meant to be null. * * @param e this indicates that a null value was returned for a non null field, which needs to cause the parent field * to become null OR continue on as an exception * * @throws NonNullableFieldWasNullException if a non null field resolves to a null value */ protected void assertNonNullFieldPrecondition(NonNullableFieldWasNullException e) throws NonNullableFieldWasNullException { ExecutionStepInfo executionStepInfo = e.getExecutionStepInfo(); if (executionStepInfo.hasParent() && executionStepInfo.getParent().isNonNullType()) { throw new NonNullableFieldWasNullException(e); } }
protected void assertNonNullFieldPrecondition(NonNullableFieldWasNullException e, CompletableFuture<?> completableFuture) throws NonNullableFieldWasNullException { ExecutionStepInfo executionStepInfo = e.getExecutionStepInfo(); if (executionStepInfo.hasParent() && executionStepInfo.getParent().isNonNullType()) { completableFuture.completeExceptionally(new NonNullableFieldWasNullException(e)); } }
/** * See (http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability), * <p> * If a non nullable child field type actually resolves to a null value and the parent type is nullable * then the parent must in fact become null * so we use exceptions to indicate this special case. However if the parent is in fact a non nullable type * itself then we need to bubble that upwards again until we get to the root in which case the result * is meant to be null. * * @param e this indicates that a null value was returned for a non null field, which needs to cause the parent field * to become null OR continue on as an exception * * @throws NonNullableFieldWasNullException if a non null field resolves to a null value */ protected void assertNonNullFieldPrecondition(NonNullableFieldWasNullException e) throws NonNullableFieldWasNullException { ExecutionStepInfo executionStepInfo = e.getExecutionStepInfo(); if (executionStepInfo.hasParent() && executionStepInfo.getParent().isNonNullType()) { throw new NonNullableFieldWasNullException(e); } }