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 inCompletableFuture
form.When thegetCompleteValueType()
isFieldValueInfo.CompleteValueType.LIST
this holds the list of completed values inside that list object.This value can be either an object that is materialized or aCompletableFuture
promise to a valueboolean
toString()
-
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 aCompletableFuture
promise to a value- Returns:
- either an object that is materialized or a
CompletableFuture
promise to a value
-
getFieldValueFuture
This returns the value inCompletableFuture
form. If it is already aCompletableFuture
it is returned directly, otherwise the materialized value is wrapped in aCompletableFuture
and returned- Returns:
- a
CompletableFuture
promise to the value
-
isFutureValue
public boolean isFutureValue()- Returns:
- true if the value is a
CompletableFuture
promise to a value
-
getFieldValueInfos
When thegetCompleteValueType()
isFieldValueInfo.CompleteValueType.LIST
this holds the list of completed values inside that list object.- Returns:
- the list of completed field values inside a list
-
toString
-