Interface ClientGraphQlResponse

All Superinterfaces:
GraphQlResponse

public interface ClientGraphQlResponse extends GraphQlResponse
GraphQlResponse for client use, with further options to handle the response.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • 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:
      field in interface GraphQlResponse
      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

      <D> D toEntity(Class<D> type)
      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 not valid
    • toEntity

      <D> D toEntity(ParameterizedTypeReference<D> type)
      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 not valid