Class ResponseBuilder

java.lang.Object
io.jmix.graphql.datafetcher.ResponseBuilder

@Component("gql_ResponseBuilder") public class ResponseBuilder extends Object
Converts entities to Map<String, Object> response format.
  • Field Details

  • Constructor Details

    • ResponseBuilder

      public ResponseBuilder()
  • Method Details

    • buildResponse

      public Map<String,Object> buildResponse(Entity entity, FetchPlan fetchPlan, MetaClass metaClass, Set<String> props)
      Convert loaded entity to data fetcher return format (Map<String, Object>)
      Parameters:
      entity - loaded entity
      fetchPlan - loaded entity properties
      metaClass - entity meta class
      props - we need pass full set of properties to have information about system props such '_instanceName'
      Returns:
      entity converted to response as Map<String, Object>
    • writeIdField

      protected void writeIdField(Entity entity, Map<String,Object> entityAsMap)