tagsAdd for product via GraphiQL APP returns Access denied for tagsAdd field

Hey there!

Trying to update tag on a product, using Shopify GraphiQL APP and permissions for writing products are in place however request:

mutation tagsAdd {
  tagsAdd(id: "gid://shopify/Product/6737412522042", tags: "b2s_upholstery_263109148730") {
    node {
      id
    }
    userErrors {
      field
      message
    }
  }
}

returns

{
  "data": {
    "tagsAdd": null
  },
  "errors": [
    {
      "message": "Access denied for tagsAdd field.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "tagsAdd"
      ],
      "extensions": {
        "code": "ACCESS_DENIED",
        "documentation": "https://shopify.dev/api/usage/access-scopes"
      }
    }
  ],
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 990,
        "restoreRate": 50
      }
    }
  }
}

Appreciate any input on topic!

when doing the same request through Postman using the API key of the private app installed on the store getting:

{
    "errors": [
        {
            "message": "Parse error on \"query\" (STRING) at [1, 2]",
            "locations": [
                {
                    "line": 1,
                    "column": 2
                }
            ]
        }
    ]
}

Ok, if I send a request with application/json instead of application/graphql header it will go through properly and return success.

Hey @b2storefront ,

Just to be sure, I tested this a few times with multiple re-installs of the GraphiQL app on my dev store environment to reset permissions, recreating the error when the write_products permissions (scope) wasn’t selected. When enabling all write permissions during the app setup process a similar mutation worked as expected:

mutation tagsAdd {
  tagsAdd(id: "gid://shopify/Product/{ID}", tags: ["12345, test, tags, add"]) {
    node {
      ... on Product {
        id
        title
        tags
      }
    }
    userErrors {
      field
      message
    }
  }
}

Also wanted to confirm your other troubleshooting. A GraphQL request needs to include the 'Content-Type: application/json' header (key-value), which can be seen noted in the example requests in cURL from the docs.

Hope that offers some confirmation and best of luck with the rest of your development - Cheers!