Class GraphQLWsResponse

java.lang.Object
io.micronaut.configuration.graphql.ws.GraphQLWsResponse

public class GraphQLWsResponse extends Object
Class to handle the message to and from the websocket.
Since:
1.3
Author:
Gerard Klijs
  • Constructor Details

    • 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 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 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 Details

    • getType

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

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

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