Interface ClientGraphQlResponse
- All Superinterfaces:
GraphQlResponse
GraphQlResponse for client use, with further options to handle the
response.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionNavigate to the given path under the "data" key of the response map where the path is a dot-separated string with optional array indexes.<D> DDecode the full response map to the given target type.<D> DtoEntity(ParameterizedTypeReference<D> type) Variant oftoEntity(Class)with aParameterizedTypeReference.Methods inherited from interface org.springframework.graphql.GraphQlResponse
getData, getErrors, getExtensions, isValid, toMap
-
Method Details
-
field
Navigate to the given path under the "data" key of the response map where the path is a dot-separated string with optional array indexes.Example paths:
"hero" "hero.name" "hero.friends" "hero.friends[2]" "hero.friends[2].name"
- Specified by:
fieldin interfaceGraphQlResponse- Parameters:
path- relative to the "data" key- Returns:
- representation for the field with further options to inspect or
decode its value; use
ResponseField.getValue()to check if the field actually has a value.
-
toEntity
Decode the full response map to the given target type.- Type Parameters:
D- the target type- Parameters:
type- the target class- Returns:
- the decoded value, or never
null - Throws:
FieldAccessException- if the response is notvalid
-
toEntity
Variant oftoEntity(Class)with aParameterizedTypeReference.- Type Parameters:
D- the target type- Parameters:
type- the target parameterized type- Returns:
- the decoded value, or never
null - Throws:
FieldAccessException- if the response is notvalid
-