Class RequestResponseDefinitionToDataModelMapper

java.lang.Object
io.github.besi97.graphql.codegen.mapper.RequestResponseDefinitionToDataModelMapper

public class RequestResponseDefinitionToDataModelMapper extends Object
Map request and response definition to a Freemarker data model
  • Constructor Details

  • Method Details

    • mapResponseProjection

      public Map<String,Object> mapResponseProjection(MappingContext mappingContext, ExtendedDefinition<?,?> definition)
      Map type definition to a Freemarker data model of Response Projection.
      Parameters:
      mappingContext - Global mapping context
      definition - GraphQL definition (type or union)
      Returns:
      Freemarker data model of the GraphQL Response Projection
    • mapParametrizedInput

      public Map<String,Object> mapParametrizedInput(MappingContext mappingContext, ExtendedFieldDefinition fieldDefinition, ExtendedDefinition<?,?> parentTypeDefinition)
      Map field definition to a Freemarker data model of Parametrized Input.
      Parameters:
      mappingContext - Global mapping context
      fieldDefinition - GraphQL field definition
      parentTypeDefinition - GraphQL parent type definition
      Returns:
      Freemarker data model of the GraphQL Parametrized Input
    • mapResponse

      public Map<String,Object> mapResponse(MappingContext mappingContext, ExtendedFieldDefinition operationDef, String objectTypeName, List<String> fieldNames)
      Map field definition to a Response Freemarker data model.
      Parameters:
      mappingContext - Global mapping context
      operationDef - GraphQL operation definition
      objectTypeName - Object type (e.g.: "Query", "Mutation" or "Subscription")
      fieldNames - Names of all fields inside the rootType. Used to detect duplicate
      Returns:
      Freemarker data model of the GraphQL response
    • mapRequest

      public Map<String,Object> mapRequest(MappingContext mappingContext, ExtendedFieldDefinition operationDef, String objectTypeName, List<String> fieldNames)
      Map field definition to a Request Freemarker data model.
      Parameters:
      mappingContext - Global mapping context
      operationDef - GraphQL operation definition
      objectTypeName - Object type (e.g.: "Query", "Mutation" or "Subscription")
      fieldNames - Names of all fields inside the rootType. Used to detect duplicate
      Returns:
      Freemarker data model of the GraphQL request