use of graphql.execution.UnresolvedTypeException in project graphql-java by graphql-java.
the class FetchedValueAnalyzer method analyzeFetchedValueImpl.
private FetchedValueAnalysis analyzeFetchedValueImpl(ExecutionContext executionContext, FetchedValue fetchedValue, Object toAnalyze, ExecutionStepInfo executionInfo) throws NonNullableFieldWasNullException {
GraphQLType fieldType = executionInfo.getUnwrappedNonNullType();
MergedField field = executionInfo.getField();
if (isList(fieldType)) {
return analyzeList(executionContext, fetchedValue, toAnalyze, executionInfo);
} else if (fieldType instanceof GraphQLScalarType) {
return analyzeScalarValue(fetchedValue, toAnalyze, (GraphQLScalarType) fieldType, executionInfo);
} else if (fieldType instanceof GraphQLEnumType) {
return analyzeEnumValue(fetchedValue, toAnalyze, (GraphQLEnumType) fieldType, executionInfo);
}
//
if (toAnalyze == null) {
return newFetchedValueAnalysis(OBJECT).fetchedValue(fetchedValue).executionStepInfo(executionInfo).nullValue().build();
}
try {
GraphQLObjectType resolvedObjectType = resolveType.resolveType(executionContext, field, toAnalyze, executionInfo, fieldType, fetchedValue.getLocalContext());
return newFetchedValueAnalysis(OBJECT).fetchedValue(fetchedValue).executionStepInfo(executionInfo).completedValue(toAnalyze).resolvedType(resolvedObjectType).build();
} catch (UnresolvedTypeException ex) {
return handleUnresolvedTypeProblem(fetchedValue, executionInfo, ex);
}
}
Aggregations