public interface ClientGraphQlResponse extends GraphQlResponse
GraphQlResponse
for client use, with further options to handle the
response.Modifier and Type | Method and Description |
---|---|
ClientResponseField |
field(String path)
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.
|
<D> D |
toEntity(Class<D> type)
Decode the full response map to the given target type.
|
<D> D |
toEntity(ParameterizedTypeReference<D> type)
Variant of
toEntity(Class) with a ParameterizedTypeReference . |
getData, getErrors, getExtensions, isValid, toMap
ClientResponseField field(String path)
Example paths:
"hero" "hero.name" "hero.friends" "hero.friends[2]" "hero.friends[2].name"
field
in interface GraphQlResponse
path
- relative to the "data" keyResponseField.hasValue()
to check if
the field actually exists and has a value.<D> D toEntity(Class<D> type)
type
- the target classnull
FieldAccessException
- if the response is not valid
<D> D toEntity(ParameterizedTypeReference<D> type)
toEntity(Class)
with a ParameterizedTypeReference
.type
- the target typenull
FieldAccessException
- if the response is not valid