@shopify/admin-graphql-api-utilities
Advanced tools
Comparing version 0.0.1 to 0.0.2-sknext-beta.2
{ | ||
"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 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23420
0
14
354
123
1
1
+ Addedtslib@^1.9.3
+ Addedtslib@1.14.1(transitive)