graphql-request-appsync-iam 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -16
- package/LICENSE +1 -1
- package/README.md +10 -11
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/package.json +63 -113
- package/build/main/index.d.ts +0 -8
- package/build/main/index.js +0 -17
- package/build/module/index.d.ts +0 -8
- package/build/module/index.js +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
## [
|
|
5
|
+
## [3.0.0](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v2.2.0...v3.0.0) (2024-03-27)
|
|
6
|
+
|
|
7
|
+
### BREAKING CHANGES
|
|
8
|
+
|
|
9
|
+
- This package is now ESM only
|
|
10
|
+
- Minimum Node version is now 18
|
|
11
|
+
- Upgraded graphql-request to 6.1.0
|
|
12
|
+
- Upgraded @scaldwell77/aws-signed-fetch to v3, which updates a lot of the underlying AWS libraries.
|
|
13
|
+
|
|
14
|
+
### Misc
|
|
6
15
|
|
|
16
|
+
Striped out a lot of development boilerplate to just keep this project simple.
|
|
17
|
+
|
|
18
|
+
## [2.2.0](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v2.1.1...v2.2.0) (2022-09-13)
|
|
7
19
|
|
|
8
20
|
### Features
|
|
9
21
|
|
|
10
|
-
|
|
22
|
+
- the guts of request signture building has been extracted to @scaldwell77/aws-signed-fetch ([0eb9d9a](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/0eb9d9a9a47c38fd52a0f9beec4fa46cea3c729c))
|
|
11
23
|
|
|
12
24
|
### [2.1.1](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v2.1.1-0...v2.1.1) (2022-07-07)
|
|
13
25
|
|
|
@@ -15,24 +27,21 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
15
27
|
|
|
16
28
|
## [2.1.0](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v1.1.6...v2.1.0) (2022-03-24)
|
|
17
29
|
|
|
18
|
-
|
|
19
30
|
### Features
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
- BREAKING CHANGE - switch to using AWS SDK v3, drop aws-sdk as peer dependency ([456c9a1](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/456c9a13cae898b6d6d29bbaf8ddcd7f62782db7))
|
|
22
33
|
|
|
23
34
|
### [1.1.6](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v1.1.5...v1.1.6) (2021-11-08)
|
|
24
35
|
|
|
25
|
-
|
|
26
36
|
### Bug Fixes
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
- refactor copying of request headers (PR [#1](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/issues/1)) to work with TypeScript ([7f7eab6](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/7f7eab6c5f66b712e74daaa18a7adbb26fe21854))
|
|
29
39
|
|
|
30
40
|
### [1.1.5](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v1.1.4...v1.1.5) (2021-10-23)
|
|
31
41
|
|
|
32
|
-
|
|
33
42
|
### Bug Fixes
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
- attempt at a workaround for headers error ([b59e5a5](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/b59e5a594bc4e8b271777f50acea19011de65135))
|
|
36
45
|
|
|
37
46
|
### [1.1.4](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v1.1.3...v1.1.4) (2021-09-07)
|
|
38
47
|
|
|
@@ -40,26 +49,22 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
40
49
|
|
|
41
50
|
### [1.1.2](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v1.1.1...v1.1.2) (2021-08-13)
|
|
42
51
|
|
|
43
|
-
|
|
44
52
|
### Bug Fixes
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
- fix typing of options ([8f539c3](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/8f539c33f1a8d0d1a01762ec4674dcb5667b1a57))
|
|
47
55
|
|
|
48
56
|
### [1.1.1](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/compare/v1.1.0...v1.1.1) (2021-08-13)
|
|
49
57
|
|
|
50
|
-
|
|
51
58
|
### Bug Fixes
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
- need to install and use cross-fetch ([feba69e](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/feba69e2ff58292250dad1bd60b4330ccf02b2e1))
|
|
54
61
|
|
|
55
62
|
## 1.1.0 (2021-08-13)
|
|
56
63
|
|
|
57
|
-
|
|
58
64
|
### Features
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
- add getGraphQLClient() ([83c88da](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/83c88da0b69566bbf88285dd3e1969fef3af0749))
|
|
62
67
|
|
|
63
68
|
### Bug Fixes
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
- add basic test ([8805945](https://github.com/stevecaldwell77/graphql-request-appsync-iam-js/commit/8805945043a8da60851d0dc176642df3a032a61e))
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -19,9 +19,10 @@ npm install graphql-request-appsync-iam
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import { getGraphQLClient } from 'graphql-request-appsync-iam'
|
|
22
|
+
import { getGraphQLClient } from 'graphql-request-appsync-iam';
|
|
23
23
|
|
|
24
|
-
const url =
|
|
24
|
+
const url =
|
|
25
|
+
'https://wvMQY3gdydNyvEJaJisxLymPbb.appsync-api.us-east-1.amazonaws.com/graphql';
|
|
25
26
|
|
|
26
27
|
// client is an instance of graphql-request's GraphQLClient
|
|
27
28
|
const client = getGraphQLClient(url);
|
|
@@ -35,8 +36,8 @@ const query = `
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
const data = await graphQLClient.request(query)
|
|
39
|
+
`;
|
|
40
|
+
const data = await graphQLClient.request(query);
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
## Configuration
|
|
@@ -47,22 +48,20 @@ and `awsRegion` options. You can also pass in any other options to
|
|
|
47
48
|
`GraphQLClient`'s constructor, except for `fetch`. Putting that all together:
|
|
48
49
|
|
|
49
50
|
```ts
|
|
50
|
-
import { getGraphQLClient } from 'graphql-request-appsync-iam'
|
|
51
|
+
import { getGraphQLClient } from 'graphql-request-appsync-iam';
|
|
51
52
|
|
|
52
|
-
const url =
|
|
53
|
+
const url =
|
|
54
|
+
'https://wvMQY3gdydNyvEJaJisxLymPbb.appsync-api.us-east-1.amazonaws.com/graphql';
|
|
53
55
|
const client = getGraphQLClient(url, {
|
|
54
56
|
awsCredentials: {
|
|
55
|
-
/* spell-checker: disable */
|
|
56
57
|
accessKeyId: 'asdfasdfd',
|
|
57
58
|
secretAccessKey: 'asdfasdfd',
|
|
58
59
|
sessionToken: 'asdfasdf',
|
|
59
|
-
/* spell-checker: enable */
|
|
60
60
|
},
|
|
61
61
|
awsRegion: 'us-east-1',
|
|
62
62
|
timeout: 60,
|
|
63
63
|
});
|
|
64
64
|
```
|
|
65
|
+
## Testing
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
NOTE: this package was bootstrapped with https://github.com/bitjson/typescript-starter
|
|
67
|
+
See [HowTo: Live test of getGraphQLClient()](./test-stack/README.md).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AwsCredentialIdentity } from '@aws-sdk/types';
|
|
2
|
+
import { GraphQLClient } from 'graphql-request';
|
|
3
|
+
type Options = Omit<RequestInit & {
|
|
4
|
+
awsCredentials?: AwsCredentialIdentity;
|
|
5
|
+
awsRegion?: string;
|
|
6
|
+
}, 'fetch'>;
|
|
7
|
+
export declare const getGraphQLClient: (url: string, options?: Options) => GraphQLClient;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,KAAK,OAAO,GAAG,IAAI,CACf,WAAW,GAAG;IACV,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,EACD,OAAO,CACV,CAAC;AASF,eAAO,MAAM,gBAAgB,QACpB,MAAM,YACD,OAAO,KAClB,aAeF,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createSignedFetch } from '@scaldwell77/aws-signed-fetch';
|
|
2
|
+
import { GraphQLClient } from 'graphql-request';
|
|
3
|
+
import { omit } from 'lodash-es';
|
|
4
|
+
// graphql-request is stricter about typing than fetch
|
|
5
|
+
const transformMethod = (method) => {
|
|
6
|
+
if (method === 'GET' || method === 'get')
|
|
7
|
+
return 'GET';
|
|
8
|
+
if (method === 'POST' || method === 'post')
|
|
9
|
+
return 'POST';
|
|
10
|
+
return undefined;
|
|
11
|
+
};
|
|
12
|
+
export const getGraphQLClient = (url, options) => {
|
|
13
|
+
const clientOptions = omit(options, ['awsCredentials', 'awsRegion']);
|
|
14
|
+
const fetch = createSignedFetch({
|
|
15
|
+
service: 'appsync',
|
|
16
|
+
awsCredentials: options?.awsCredentials,
|
|
17
|
+
awsRegion: options?.awsRegion,
|
|
18
|
+
});
|
|
19
|
+
const client = new GraphQLClient(url, {
|
|
20
|
+
...clientOptions,
|
|
21
|
+
method: transformMethod(clientOptions.method),
|
|
22
|
+
fetch,
|
|
23
|
+
});
|
|
24
|
+
return client;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUjC,sDAAsD;AACtD,MAAM,eAAe,GAAG,CAAC,MAAe,EAA8B,EAAE;IACpE,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACvD,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1D,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC5B,GAAW,EACX,OAAiB,EACJ,EAAE;IACf,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,iBAAiB,CAAC;QAC5B,OAAO,EAAE,SAAS;QAClB,cAAc,EAAE,OAAO,EAAE,cAAc;QACvC,SAAS,EAAE,OAAO,EAAE,SAAS;KAChC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,GAAG,EAAE;QAClC,GAAG,aAAa;QAChB,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC;QAC7C,KAAK;KACR,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,117 +1,67 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"doc:html": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out build/docs",
|
|
35
|
-
"doc:json": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json",
|
|
36
|
-
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
|
|
37
|
-
"version": "standard-version",
|
|
38
|
-
"reset-hard": "git clean -dfx && git reset --hard && yarn",
|
|
39
|
-
"prepare-release": "run-s reset-hard test doc:html version doc:publish",
|
|
40
|
-
"prepare": "husky install"
|
|
41
|
-
},
|
|
42
|
-
"engines": {
|
|
43
|
-
"node": ">=10"
|
|
44
|
-
},
|
|
45
|
-
"dependencies": {
|
|
46
|
-
"@scaldwell77/aws-signed-fetch": "^1.1.0",
|
|
47
|
-
"graphql-request": "^3.5.0",
|
|
48
|
-
"lodash": "^4.17.21"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@ava/typescript": "^1.1.1",
|
|
52
|
-
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
|
53
|
-
"@types/lodash": "^4.14.172",
|
|
54
|
-
"@types/node": "^16.6.1",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^4.0.1",
|
|
56
|
-
"@typescript-eslint/parser": "^4.0.1",
|
|
57
|
-
"ava": "^3.12.1",
|
|
58
|
-
"codecov": "^3.5.0",
|
|
59
|
-
"commitizen": "^4.2.4",
|
|
60
|
-
"cspell": "^4.1.0",
|
|
61
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
62
|
-
"eslint": "^7.8.0",
|
|
63
|
-
"eslint-config-prettier": "^6.11.0",
|
|
64
|
-
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
65
|
-
"eslint-plugin-import": "^2.22.0",
|
|
66
|
-
"gh-pages": "^3.1.0",
|
|
67
|
-
"graphql": "14 - 16",
|
|
68
|
-
"husky": "^7.0.1",
|
|
69
|
-
"npm-run-all": "^4.1.5",
|
|
70
|
-
"nyc": "^15.1.0",
|
|
71
|
-
"open-cli": "^6.0.1",
|
|
72
|
-
"prettier": "^2.1.1",
|
|
73
|
-
"standard-version": "^9.0.0",
|
|
74
|
-
"ts-node": "^9.0.0",
|
|
75
|
-
"typedoc": "^0.19.0",
|
|
76
|
-
"typescript": "^4.0.2"
|
|
77
|
-
},
|
|
78
|
-
"peerDependencies": {
|
|
79
|
-
"graphql": "14 - 16"
|
|
80
|
-
},
|
|
81
|
-
"files": [
|
|
82
|
-
"build/main",
|
|
83
|
-
"build/module",
|
|
84
|
-
"!**/*.spec.*",
|
|
85
|
-
"!**/*.json",
|
|
86
|
-
"CHANGELOG.md",
|
|
87
|
-
"LICENSE",
|
|
88
|
-
"README.md"
|
|
89
|
-
],
|
|
90
|
-
"ava": {
|
|
91
|
-
"failFast": true,
|
|
92
|
-
"timeout": "60s",
|
|
93
|
-
"typescript": {
|
|
94
|
-
"rewritePaths": {
|
|
95
|
-
"src/": "build/main/"
|
|
96
|
-
}
|
|
2
|
+
"name": "graphql-request-appsync-iam",
|
|
3
|
+
"description": "Extension of graphql-request that can be used to make calls to an AppSync API using IAM authorization.",
|
|
4
|
+
"version": "3.0.0",
|
|
5
|
+
"ava": {
|
|
6
|
+
"typescript": {
|
|
7
|
+
"rewritePaths": {
|
|
8
|
+
"src/": "dist/"
|
|
9
|
+
},
|
|
10
|
+
"compile": false
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@scaldwell77/aws-signed-fetch": "^3.0.1",
|
|
15
|
+
"graphql-request": "^6.1.0",
|
|
16
|
+
"lodash-es": "^4.17.21"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@ava/typescript": "^4.1.0",
|
|
20
|
+
"@aws-sdk/types": "^3.535.0",
|
|
21
|
+
"@types/lodash-es": "^4.17.12",
|
|
22
|
+
"@types/node": "^20.11.30",
|
|
23
|
+
"ava": "^6.1.2",
|
|
24
|
+
"eslint": "^8.57.0",
|
|
25
|
+
"eslint-config-prettier": "^9.1.0",
|
|
26
|
+
"husky": "^9.0.11",
|
|
27
|
+
"prettier": "^3.2.5",
|
|
28
|
+
"rimraf": "^5.0.5",
|
|
29
|
+
"typescript": "^5.4.3",
|
|
30
|
+
"typescript-eslint": "^7.4.0"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
97
34
|
},
|
|
98
35
|
"files": [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
36
|
+
"dist",
|
|
37
|
+
"!**/*.spec.*",
|
|
38
|
+
"CHANGELOG.md",
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"keywords": [],
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"lint-staged": {
|
|
45
|
+
"*.js": "eslint --cache --fix",
|
|
46
|
+
"*.{js,css,md}": "prettier --write"
|
|
47
|
+
},
|
|
48
|
+
"main": "dist/index.js",
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"graphql": "14 - 16"
|
|
51
|
+
},
|
|
52
|
+
"prettier": {
|
|
53
|
+
"singleQuote": true,
|
|
54
|
+
"tabWidth": 4
|
|
55
|
+
},
|
|
56
|
+
"repository": "https://github.com/stevecaldwell77/graphql-request-appsync-iam-js",
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "rimraf dist && tsc",
|
|
59
|
+
"format": "prettier --write .",
|
|
60
|
+
"lint": "eslint .",
|
|
61
|
+
"lint:fix": "eslint . --fix",
|
|
62
|
+
"prepare": "husky",
|
|
63
|
+
"test": "pnpm run build && ava"
|
|
64
|
+
},
|
|
65
|
+
"type": "module",
|
|
66
|
+
"types": "dist/index.d.ts"
|
|
117
67
|
}
|
package/build/main/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Credentials } from '@aws-sdk/types';
|
|
2
|
-
import { GraphQLClient } from 'graphql-request';
|
|
3
|
-
declare type Options = Omit<RequestInit & {
|
|
4
|
-
awsCredentials?: Credentials;
|
|
5
|
-
awsRegion?: string;
|
|
6
|
-
}, 'fetch'>;
|
|
7
|
-
export declare const getGraphQLClient: (url: string, options?: Options | undefined) => GraphQLClient;
|
|
8
|
-
export {};
|
package/build/main/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGraphQLClient = void 0;
|
|
4
|
-
const aws_signed_fetch_1 = require("@scaldwell77/aws-signed-fetch");
|
|
5
|
-
const graphql_request_1 = require("graphql-request");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
const getGraphQLClient = (url, options) => {
|
|
8
|
-
const clientOptions = lodash_1.omit(options, ['awsCredentials', 'awsRegion']);
|
|
9
|
-
const fetch = aws_signed_fetch_1.createSignedFetch({
|
|
10
|
-
service: 'appsync',
|
|
11
|
-
awsCredentials: options === null || options === void 0 ? void 0 : options.awsCredentials,
|
|
12
|
-
awsRegion: options === null || options === void 0 ? void 0 : options.awsRegion,
|
|
13
|
-
});
|
|
14
|
-
return new graphql_request_1.GraphQLClient(url, Object.assign(Object.assign({}, clientOptions), { fetch }));
|
|
15
|
-
};
|
|
16
|
-
exports.getGraphQLClient = getGraphQLClient;
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0Esb0VBQWtFO0FBQ2xFLHFEQUFnRDtBQUNoRCxtQ0FBOEI7QUFVdkIsTUFBTSxnQkFBZ0IsR0FBRyxDQUM1QixHQUFXLEVBQ1gsT0FBaUIsRUFDSixFQUFFO0lBQ2YsTUFBTSxhQUFhLEdBQUcsYUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDLGdCQUFnQixFQUFFLFdBQVcsQ0FBQyxDQUFDLENBQUM7SUFDckUsTUFBTSxLQUFLLEdBQUcsb0NBQWlCLENBQUM7UUFDNUIsT0FBTyxFQUFFLFNBQVM7UUFDbEIsY0FBYyxFQUFFLE9BQU8sYUFBUCxPQUFPLHVCQUFQLE9BQU8sQ0FBRSxjQUFjO1FBQ3ZDLFNBQVMsRUFBRSxPQUFPLGFBQVAsT0FBTyx1QkFBUCxPQUFPLENBQUUsU0FBUztLQUNoQyxDQUFDLENBQUM7SUFDSCxPQUFPLElBQUksK0JBQWEsQ0FBQyxHQUFHLGtDQUNyQixhQUFhLEtBQ2hCLEtBQUssSUFDUCxDQUFDO0FBQ1AsQ0FBQyxDQUFDO0FBZFcsUUFBQSxnQkFBZ0Isb0JBYzNCIn0=
|
package/build/module/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Credentials } from '@aws-sdk/types';
|
|
2
|
-
import { GraphQLClient } from 'graphql-request';
|
|
3
|
-
declare type Options = Omit<RequestInit & {
|
|
4
|
-
awsCredentials?: Credentials;
|
|
5
|
-
awsRegion?: string;
|
|
6
|
-
}, 'fetch'>;
|
|
7
|
-
export declare const getGraphQLClient: (url: string, options?: Options | undefined) => GraphQLClient;
|
|
8
|
-
export {};
|
package/build/module/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createSignedFetch } from '@scaldwell77/aws-signed-fetch';
|
|
2
|
-
import { GraphQLClient } from 'graphql-request';
|
|
3
|
-
import { omit } from 'lodash';
|
|
4
|
-
export const getGraphQLClient = (url, options) => {
|
|
5
|
-
const clientOptions = omit(options, ['awsCredentials', 'awsRegion']);
|
|
6
|
-
const fetch = createSignedFetch({
|
|
7
|
-
service: 'appsync',
|
|
8
|
-
awsCredentials: options?.awsCredentials,
|
|
9
|
-
awsRegion: options?.awsRegion,
|
|
10
|
-
});
|
|
11
|
-
return new GraphQLClient(url, {
|
|
12
|
-
...clientOptions,
|
|
13
|
-
fetch,
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDbEUsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFVOUIsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsQ0FDNUIsR0FBVyxFQUNYLE9BQWlCLEVBQ0osRUFBRTtJQUNmLE1BQU0sYUFBYSxHQUFHLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQyxnQkFBZ0IsRUFBRSxXQUFXLENBQUMsQ0FBQyxDQUFDO0lBQ3JFLE1BQU0sS0FBSyxHQUFHLGlCQUFpQixDQUFDO1FBQzVCLE9BQU8sRUFBRSxTQUFTO1FBQ2xCLGNBQWMsRUFBRSxPQUFPLEVBQUUsY0FBYztRQUN2QyxTQUFTLEVBQUUsT0FBTyxFQUFFLFNBQVM7S0FDaEMsQ0FBQyxDQUFDO0lBQ0gsT0FBTyxJQUFJLGFBQWEsQ0FBQyxHQUFHLEVBQUU7UUFDMUIsR0FBRyxhQUFhO1FBQ2hCLEtBQUs7S0FDUixDQUFDLENBQUM7QUFDUCxDQUFDLENBQUMifQ==
|