Module evita.external.api.graphql
Record Class GraphQLResponse<T>
java.lang.Object
java.lang.Record
io.evitadb.externalApi.graphql.io.GraphQLResponse<T>
- Type Parameters:
T- result data
public record GraphQLResponse<T>(@Nullable T data, @Nullable List<io.evitadb.externalApi.graphql.io.GraphQLResponse.GraphQLResponseError> errors)
extends Record
Response from GraphQL passed as output to client.
- Author:
- Lukáš Hornych, FG Forrest a.s. (c) 2022
-
Constructor Summary
ConstructorsConstructorDescriptionGraphQLResponse(T data, List<io.evitadb.externalApi.graphql.io.GraphQLResponse.GraphQLResponseError> errors) Creates an instance of aGraphQLResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.List<io.evitadb.externalApi.graphql.io.GraphQLResponse.GraphQLResponseError>errors()Returns the value of theerrorsrecord component.static <T> GraphQLResponse<T>fromExecutionResult(graphql.ExecutionResult executionResult) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GraphQLResponse
public GraphQLResponse(@Nullable T data, @Nullable List<io.evitadb.externalApi.graphql.io.GraphQLResponse.GraphQLResponseError> errors) Creates an instance of aGraphQLResponserecord class.- Parameters:
data- the value for thedatarecord componenterrors- the value for theerrorsrecord component
-
-
Method Details
-
fromExecutionResult
public static <T> GraphQLResponse<T> fromExecutionResult(@Nonnull graphql.ExecutionResult executionResult) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
errors
@Nullable public List<io.evitadb.externalApi.graphql.io.GraphQLResponse.GraphQLResponseError> errors()Returns the value of theerrorsrecord component.- Returns:
- the value of the
errorsrecord component
-