Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/admin-graphql-api-utilities

Package Overview
Dependencies
Maintainers
13
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/admin-graphql-api-utilities - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2-sknext-beta.2

build/cjs/index.js

39

package.json
{
"name": "@shopify/admin-graphql-api-utilities",
"version": "0.0.1",
"version": "0.0.2-sknext-beta.2",
"license": "MIT",
"description": "A set of utilities to use when consuming Shopify’s admin graphql api.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"description": "A set of utilities to use when consuming Shopify’s admin GraphQL API",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"build": "tsc --p tsconfig.build.json",
"prepublishOnly": "yarn run build"
"build": "tsc --p tsconfig.json"
},

@@ -19,11 +18,31 @@ "publishConfig": {

"type": "git",
"url": "git+https://github.com/Shopify/quilt.git"
"url": "git+https://github.com/Shopify/quilt.git",
"directory": "packages/admin-graphql-api-utilities"
},
"bugs": {
"url": "https://github.com/shopify/quilt/issues"
"url": "https://github.com/Shopify/quilt/issues"
},
"homepage": "https://github.com/Shopify/quilt/blob/master/packages/admin-graphql-api-utilities/README.md",
"devDependencies": {
"typescript": "~3.0.1"
"sideEffects": false,
"dependencies": {
"tslib": "^1.9.3"
},
"files": [
"build/*",
"!tsconfig.tsbuildinfo",
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts"
],
"module": "index.mjs",
"esnext": "index.esnext",
"exports": {
"./": "./",
"./index": {
"import": "./index.mjs",
"require": "./index.js",
"esnext": "./index.esnext"
}
}
}

@@ -6,3 +6,3 @@ # `@shopify/admin-graphql-api-utilities`

A set of utilities to use when consuming Shopify’s admin graphql api.
A set of utilities to use when consuming Shopify’s admin GraphQL API.

@@ -17,2 +17,15 @@ ## Installation

### `parseGidType(gid: string): string`
Given a Gid string, parse out the type.
#### Example Usage
```typescript
import {parseGidType} from '@shopify/admin-graphql-api-utilities';
parseGidType('gid://shopify/Customer/12345');
// → 'Customer'
```
### `function parseGid(gid: string): string`

@@ -31,4 +44,35 @@

### `function composeGid(key: string, id: number | string): string`
### `function parseGidWithParams(gid: string): ParsedGid`
Given a Gid string, parse out the id and its params.
#### Example Usage
```typescript
import {parseGidWithParams} from '@shopify/admin-graphql-api-utilities';
parseGidWithParams('gid://shopify/Customer/12345?sessionId=123&foo=bar');
// → {
// id: '12345',
// params: {sessionId: '123', foo: 'bar'}
// }
```
### `function composeGidFactory(namespace: string): Function`
Create a new `composeGid` with a given namespace instead of the default `shopify` namespace.
#### Example Usage
```typescript
import {composeGidFactory} from '@shopify/admin-graphql-api-utilities';
const composeGid = composeGidFactory('CustomApp');
composeGid('Product', '123');
// → 'gid://CustomApp/Product/123'
```
### `function composeGid(key: string, id: number | string, params: Record<string, string> = {}): string`
Given a key and id, compose a Gid string.

@@ -44,4 +88,4 @@

composeGid('Customer', '67890');
// → 'gid://shopify/Customer/67890'
composeGid('Customer', '67890', {foo: 'bar'});
// → 'gid://shopify/Customer/67890?foo=bar'
```

@@ -48,0 +92,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc