Class GraphQLWsResponse


  • public class GraphQLWsResponse
    extends java.lang.Object
    Class to handle the message to and from the websocket.
    Since:
    1.3
    • Constructor Detail

      • GraphQLWsResponse

        public GraphQLWsResponse​(GraphQLWsResponse.ServerType serverType)
        Constructor for messages with just the type, like errors.
        Parameters:
        serverType - type as serverType
      • GraphQLWsResponse

        public GraphQLWsResponse​(GraphQLWsResponse.ServerType serverType,
                                 @Nullable
                                 java.lang.String id)
        Constructor for messages with only serverType and id, like the stop message.
        Parameters:
        serverType - serverType as serverType
        id - id as string
      • GraphQLWsResponse

        public GraphQLWsResponse​(GraphQLWsResponse.ServerType serverType,
                                 @Nullable
                                 java.lang.String id,
                                 @Nullable
                                 GraphQLResponseBody payload)
        Constructor having all the types, like a graphql query response.
        Parameters:
        serverType - serverType as string
        id - id as string
        payload - payload as string
    • Method Detail

      • getType

        public java.lang.String getType()
        Get the type.
        Returns:
        the type of message as string
      • getId

        @Nullable
        public java.lang.String getId()
        Get the id.
        Returns:
        id as string
      • getPayload

        @Nullable
        public GraphQLResponseBody getPayload()
        Get the payload.
        Returns:
        result of the query