Class Builder


  • public class Builder
    extends java.lang.Object
    This builder is provided for compatibility of existing code, that would have been developed before the 1.6 release. It allows to create ObjectResponse, that will define the content of the GraphQL request toward the server.
    Author:
    etienne-sf
    • Constructor Detail

      • Builder

        public Builder​(java.lang.Class<? extends AbstractGraphQLRequest> graphQLRequestClass)
        This Builder allows to build a Full request, that is request as you can execute in the graphiql interface.
        When calling the withQueryResponseDef(String), a new AbstractGraphQLRequest is created by calling its AbstractGraphQLRequest#AbstractGraphQLRequest(String) constructor.
        Parameters:
        graphQLRequestClass - The graphQLRequestClass inherits from AbstractGraphQLRequest, and contains the generated context that allows proper GraphQL request executions
      • Builder

        public Builder​(java.lang.Class<? extends AbstractGraphQLRequest> graphQLRequestClass,
                       java.lang.String fieldName,
                       RequestType requestType,
                       InputParameter... inputParams)
        This Builder allows to build a Partial request, that is a request for only one query/mutation/subscription.
        When calling the withQueryResponseDef(String), the query request can be something like the one below, based on the hero query of the star wars schema:
         {id appearsIn friends {name friends {friends{id name appearsIn}}}}
         
        This defines only the part of the GraphQL request that defines the expected response content from the GraphQL server.
        Parameters:
        graphQLRequestClass - The graphQLRequestClass inherits from AbstractGraphQLRequest, and contains the generated context that allows proper GraphQL request executions
        fieldName - The query/mutation/subscription name, as defined in the GraphQL schema
        requestType - The request type allows to search fieldName in the query or in the mutation or the subscription
        inputParams - The input parameters for this query/mutation/subscription