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 Summary
ConstructorDescriptionMetaServlet
(@NotNull MetaStore metaStore, @NotNull JsonDocumentParser jsonDocumentParser) DI constructor. -
Method Summary
-
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
- ifmetaStore
isnull
-
-
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
andoperationName
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
- ifquery
isnull
-
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
andoperationName
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
- ifgraphQLDocument
isnull
IllegalArgumentException
- if no metadata fields are found ingraphQLDocument
-