Class MetaServlet

java.lang.Object
io.github.qubitpi.athena.web.endpoints.MetaServlet

@Singleton @Immutable @ThreadSafe @Path("/metadata/graphql") @Produces("application/json") public class MetaServlet extends Object
Endpoint for POSTing and GETing file metadata.

This is the resource that serves GraphQL over HTTP. See GraphQL documentation for specifications on serving GraphQL over HTTP.

  • Constructor Details

    • MetaServlet

      @Inject public MetaServlet(@NotNull @NotNull MetaStore metaStore, @NotNull @NotNull JsonDocumentParser jsonDocumentParser)
      DI constructor.
      Parameters:
      metaStore - A delegating layer that handles all REST operations.
      jsonDocumentParser - An object for extracting metadata request info from POST request body, such as file ID and metadata fields that client is asking for.
      Throws:
      NullPointerException - if metaStore is null
  • Method Details

    • get

      @GET @NotNull public @NotNull jakarta.ws.rs.core.Response get(@NotNull @QueryParam("query") @NotNull String query)
      Query metadata via GraphQL GET.

      Note that in the context of Athena, variables and operationName path params are not supported here. Please check out GraphQL documentation for more details.

      Parameters:
      query - A native GraphQL query operation definition, such as "query={me{name}}"
      Returns:
      native GraphQL query result
      Throws:
      NullPointerException - if query is null
    • post

      @POST @Consumes("application/json") public jakarta.ws.rs.core.Response post(@NotNull @NotNull String graphQLDocument)
      Query metadata via GraphQL POST.

      Note that in the context of Athena, variables and operationName fields are optional and will not be processed. Please check out GraphQL documentation for more details.

      Parameters:
      graphQLDocument - A native GraphQL document as a JSON-encoded body of the following form:
       
       {
           "query": "..."
       }
       
       
      Returns:
      native GraphQL query result
      Throws:
      NullPointerException - if graphQLDocument is null
      IllegalArgumentException - if no metadata fields are found in graphQLDocument