FROM CACHE - en_header

Cannot find Collection legacyResouceId from GraphQL

puda_cb
Tourist
7 0 0

I'm trying to save the legacyResourceId of a collection, but I'm only able to get the graphql Id of it. I need the REST id for my particular need.

Any help is appreciated!

Thanks!

Replies 2 (2)
puda_cb
Tourist
7 0 0
Greg_Kujawa
Shopify Partner
1023 84 268

This does appear to be the case. Although if the mapping holds true then the segment after the final forward slash in the GID would be equivalent (e.g. - gid://shopify/Collection/155122597940). Although this could change down the road sometime, would break the mapping, and you would indeed need to know the true legacyResourceId.

Here's what I got as a response, confirming this field doesn't appear to be accessible using the GQL API.

 

{
  "errors": [
    {
      "message": "Field 'legacyResourceId' doesn't exist on type 'Collection'",
      "locations": [
        {
          "line": 5,
          "column": 5
        }
      ],
      "path": [
        "query",
        "collection",
        "legacyResourceId"
      ],
      "extensions": {
        "code": "undefinedField",
        "typeName": "Collection",
        "fieldName": "legacyResourceId"
      }
    }
  ]
}

 

Can a Shopify rep please speak to this?