---
title: parseGid
description: Parses Shopify Global ID (GID) and returns the resource type and ID.
api_version: 2026-04
source_url:
  html: 'https://shopify.dev/docs/api/hydrogen/latest/utilities/parsegid'
  md: 'https://shopify.dev/docs/api/hydrogen/latest/utilities/parsegid.md'
api_name: hydrogen
---

# parseGid

Parses [Shopify Global ID (GID)](https://shopify.dev/api/usage/gids) and returns the resource type and ID.

## parse​Gid(**[gid](#props-propertydetail-gid)**​)

Parses global id (gid) and returns the resource type and id.

### Parameters

* **gid**

  **string**

  **required**

  A shopify GID (string)

### Returns

* **ShopifyGid**

### ShopifyGid

```ts
Pick<URL, 'search' | 'searchParams' | 'hash'> & {
  id: string;
  resource: string | null;
  resourceId: string | null;
}
```

Examples

### Examples

* ####

  ##### JavaScript

  ```js
  import {parseGid} from '@shopify/hydrogen';

  const {id, resource} = parseGid('gid://shopify/Order/123');

  console.log(id); // 123
  console.log(resource); // Order
  ```

***
