Package graphql.execution
Class FieldValueInfo
java.lang.Object
graphql.execution.FieldValueInfo
The
FieldValueInfo holds the type of field that was fetched and completed along with the completed value.
A field value is considered when its is both fetch via a DataFetcher to a raw value, and then
it is serialized into scalar or enum or if it's an object type, it is completed as an object given its field sub selection
The getFieldValueObject() method returns either a materialized value or a CompletableFuture
promise to a materialized value. Simple in-memory values will tend to be materialized, while complicated
values might need a call to a database or other systems will tend to be CompletableFuture promises.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, Object fieldValueObject) FieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, Object fieldValueObject, List<FieldValueInfo> fieldValueInfos) -
Method Summary
Modifier and TypeMethodDescriptionThis is an enum that represents the type of field value that was completed for a fieldThis returns the value inCompletableFutureform.When thegetCompleteValueType()isFieldValueInfo.CompleteValueType.LISTthis holds the list of completed values inside that list object.This value can be either an object that is materialized or aCompletableFuturepromise to a valuebooleantoString()
-
Constructor Details
-
FieldValueInfo
-
FieldValueInfo
public FieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, Object fieldValueObject, List<FieldValueInfo> fieldValueInfos)
-
-
Method Details
-
getCompleteValueType
This is an enum that represents the type of field value that was completed for a field- Returns:
- the type of field value
-
getFieldValueObject
This value can be either an object that is materialized or aCompletableFuturepromise to a value- Returns:
- either an object that is materialized or a
CompletableFuturepromise to a value
-
getFieldValueFuture
This returns the value inCompletableFutureform. If it is already aCompletableFutureit is returned directly, otherwise the materialized value is wrapped in aCompletableFutureand returned- Returns:
- a
CompletableFuturepromise to the value
-
isFutureValue
public boolean isFutureValue()- Returns:
- true if the value is a
CompletableFuturepromise to a value
-
getFieldValueInfos
When thegetCompleteValueType()isFieldValueInfo.CompleteValueType.LISTthis holds the list of completed values inside that list object.- Returns:
- the list of completed field values inside a list
-
toString
-