protected GraphQLObjectType resolveType(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLType fieldType) { return resolvedType.resolveType(executionContext, parameters.getField(), parameters.getSource(), parameters.getArguments(), fieldType); }
@Override @SuppressWarnings("FutureReturnValueIgnored") public CompletableFuture<ExecutionResult> execute(ExecutionContext executionContext, ExecutionStrategyParameters parameters) { InstrumentationContext<ExecutionResult> executionStrategyCtx = executionContext.getInstrumentation() .beginExecutionStrategy(new InstrumentationExecutionStrategyParameters(executionContext, parameters)); GraphQLObjectType type = (GraphQLObjectType) parameters.getExecutionStepInfo().getUnwrappedNonNullType(); ExecutionNode root = new ExecutionNode(type, parameters.getExecutionStepInfo(), parameters.getFields().getSubFields(), singletonList(MapOrList.createMap(new LinkedHashMap<>())), Collections.singletonList(parameters.getSource()) ); Queue<ExecutionNode> nodes = new ArrayDeque<>(); CompletableFuture<ExecutionResult> result = new CompletableFuture<>(); executeImpl(executionContext, parameters, root, root, nodes, root.getFields().keySet().iterator(), result); executionStrategyCtx.onDispatched(result); result.whenComplete(executionStrategyCtx::onCompleted); return result; }
.source(parameters.getSource()) .localContext(parameters.getLocalContext()) .arguments(argumentValues)
Object result = UnboxPossibleOptional.unboxPossibleOptional(parameters.getSource()); GraphQLType fieldType = executionStepInfo.getUnwrappedNonNullType(); CompletableFuture<ExecutionResult> fieldValue;
protected GraphQLObjectType resolveType(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLType fieldType) { return resolvedType.resolveType(executionContext, parameters.getField(), parameters.getSource(), parameters.getArguments(), fieldType); }
@Override @SuppressWarnings("FutureReturnValueIgnored") public CompletableFuture<ExecutionResult> execute(ExecutionContext executionContext, ExecutionStrategyParameters parameters) { InstrumentationContext<ExecutionResult> executionStrategyCtx = executionContext.getInstrumentation() .beginExecutionStrategy(new InstrumentationExecutionStrategyParameters(executionContext, parameters)); GraphQLObjectType type = (GraphQLObjectType) parameters.getExecutionStepInfo().getUnwrappedNonNullType(); ExecutionNode root = new ExecutionNode(type, parameters.getExecutionStepInfo(), parameters.getFields().getSubFields(), singletonList(MapOrList.createMap(new LinkedHashMap<>())), Collections.singletonList(parameters.getSource()) ); Queue<ExecutionNode> nodes = new ArrayDeque<>(); CompletableFuture<ExecutionResult> result = new CompletableFuture<>(); executeImpl(executionContext, parameters, root, root, nodes, root.getFields().keySet().iterator(), result); executionStrategyCtx.onDispatched(result); result.whenComplete(executionStrategyCtx::onCompleted); return result; }
@Override protected FieldValueInfo completeValue(ExecutionContext executionContext, ExecutionStrategyParameters parameters) throws NonNullableFieldWasNullException { graphql.schema.GraphQLType fieldType = parameters.getExecutionStepInfo().getType(); Object result = parameters.getSource(); if (result instanceof Enum && fieldType instanceof GraphQLEnumType) { Object value = ((GraphQLEnumType) fieldType).getCoercing().parseValue(((Enum) result).name()); return super.completeValue(executionContext, withSource(parameters, value)); } if (result instanceof Optional) { Object value = ((Optional<?>) result).orElse(null); return completeValue(executionContext, withSource(parameters, value)); } return super.completeValue(executionContext, parameters); }
.source(parameters.getSource()) .localContext(parameters.getLocalContext()) .arguments(argumentValues)
Object result = UnboxPossibleOptional.unboxPossibleOptional(parameters.getSource()); GraphQLType fieldType = executionStepInfo.getUnwrappedNonNullType(); CompletableFuture<ExecutionResult> fieldValue;