{
  "name": "graphql-query",
  "title": "Run a GraphQL query",
  "category": "HTTP",
  "tags": [
    "curl-jq",
    "http"
  ],
  "version": "1.0.2",
  "date": "2026-09-12",
  "notes": "Move to badouralix/curl-jq:ubuntu. The Alpine build this pinned carries two jq advisories on the path this item takes, and its publisher has not rebuilt it since 1 July. The ubuntu tag has neither, and fixable CRITICAL/HIGH drops from 4 to 2. It is Ubuntu 24.04 rather than Alpine, so sh is dash rather than busybox ash, curl goes back from 8.21.0 to 8.5.0 and jq from 1.8.1 to 1.7.1. Still runs as root.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/graphql-query/1.0.2.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/graphql-query/1.0.2/template.yaml",
  "entrypoint": "query",
  "parameters": [
    {
      "name": "endpoint",
      "title": "Endpoint",
      "description": "Absolute GraphQL endpoint URL.",
      "type": "string",
      "required": true,
      "example": "https://api.example.com/graphql"
    },
    {
      "name": "query",
      "title": "Query",
      "description": "The GraphQL query (or mutation) document.",
      "type": "string",
      "required": true,
      "example": "query($id: ID!) { user(id: $id) { name } }"
    },
    {
      "name": "token-secret-key",
      "title": "Token secret key",
      "description": "Key within the Secret that holds the bearer token.",
      "type": "string",
      "required": false,
      "default": "token"
    },
    {
      "name": "token-secret-name",
      "title": "Token secret name",
      "description": "Name of the Kubernetes Secret holding the bearer token.",
      "type": "string",
      "required": false,
      "default": "graphql-token"
    },
    {
      "name": "variables-json",
      "title": "Variables (JSON)",
      "description": "JSON object of query variables.",
      "type": "string",
      "required": false,
      "default": "{}",
      "example": "{\"id\":\"123\"}"
    }
  ],
  "images": [
    {
      "ref": "badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2",
      "repository": "badouralix/curl-jq",
      "digest": "sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/graphql-query/1.0.2/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/graphql-query/1.0.2/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: graphql-query\n  labels:\n    dagweave.io/catalog-item: graphql-query\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.2\"\n    dagweave.io/catalog-category: \"HTTP\"\nspec:\n  entrypoint: query\n  templates:\n    - name: query\n      inputs:\n        parameters:\n          # Absolute GraphQL endpoint URL.\n          - name: endpoint\n          # The GraphQL query (or mutation) document.\n          - name: query\n          # JSON object of query variables. Defaults to an empty object.\n          - name: variables-json\n            default: \"{}\"\n          # Name/key of a Kubernetes Secret holding the bearer token.\n          - name: token-secret-name\n            default: graphql-token\n          - name: token-secret-key\n            default: token\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # badouralix/curl-jq:ubuntu — provides sh, curl and jq.\n        image: badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2\n        command: [sh, -c]\n        # Values are passed as env vars (below), never interpolated into the shell.\n        # jq assembles the {query, variables} request body with --arg / --argjson so\n        # a query containing quotes or newlines is escaped correctly.\n        args:\n          - |\n            set -eu\n            BODY=$(jq -cn --arg q \"${QUERY}\" --argjson v \"${VARIABLES}\" \\\n              '{query: $q, variables: $v}')\n            curl -sSf -X POST \"${ENDPOINT}\" \\\n              -H \"Content-Type: application/json\" \\\n              -H \"Authorization: Bearer ${TOKEN}\" \\\n              --data-raw \"${BODY}\"\n        env:\n          - name: ENDPOINT\n            value: \"{{inputs.parameters.endpoint}}\"\n          - name: QUERY\n            value: \"{{inputs.parameters.query}}\"\n          - name: VARIABLES\n            value: \"{{inputs.parameters.variables-json}}\"\n          - name: TOKEN\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.token-secret-name}}\"\n                key: \"{{inputs.parameters.token-secret-key}}\"\n",
  "templateSha256": "676d50f88344f6caf4a4fb5f017d0a9a9699214ceb6ccbc349e93ff1bc7b5a50",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/graphql-query",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
