Class GraphQLResource


  • public class GraphQLResource
    extends ExternalResource
    Class for working with a GraphQL endpoint as Resource.
    • Constructor Detail

      • GraphQLResource

        public GraphQLResource​(java.lang.String endpoint,
                               java.lang.String query,
                               java.lang.String fileName,
                               com.google.gson.JsonArray headers,
                               java.lang.String auth)
        Resource from a GraphQL endpoint.
        Parameters:
        endpoint - URL of the data source from where the JSON needs to be read.
        query - GraphQL query.
        fileName - Name of the output file.
        headers - HTTP headers, e.g. [{"Content-Type":"application/json"},{"Custom-Auth-Token":"xysazxklj4568asdf46a5sd4f"}]
        auth - Basic authentication i.e. 'user:password' to compute an Authorization header.
    • Method Detail

      • getQuery

        public java.lang.String getQuery()
        Returns:
        GraphQL query.
      • setQuery

        public void setQuery​(java.lang.String query)
        Parameters:
        query - GraphQL query.
      • getJSON

        public com.google.gson.JsonObject getJSON()
        Overrides:
        getJSON in class ExternalResource
        Returns:
        JSONObject with the tags for this element for the Cloud Office Print server.
      • getTemplateTags

        public java.util.Set<java.lang.String> getTemplateTags()
        Cannot be used for a resource.
        Specified by:
        getTemplateTags in class RenderElement
        Returns:
        null