use of jetbrains.buildServer.server.graphql.util.EntityNotFoundGraphQLError in project teamcity-rest by JetBrains.
the class CloudImageResolver method agentTypeRawId.
@NotNull
public DataFetcherResult<Integer> agentTypeRawId(@NotNull CloudImage image, @NotNull DataFetchingEnvironment env) {
DataFetcherResult.Builder<Integer> result = DataFetcherResult.newResult();
AgentType agentType = findAgentType(image);
if (agentType == null) {
return result.error(new EntityNotFoundGraphQLError(String.format("Agent type for image id=%s is no found.", image.getRawId()))).build();
}
return result.data(agentType.getAgentTypeId()).build();
}
Aggregations