@graphql-tools/github-loader
Advanced tools
Comparing version 7.3.28-alpha-20230407131203-6663dff6 to 7.3.28-alpha-20230407140332-1a85b75e
@@ -106,9 +106,12 @@ "use strict"; | ||
prepareRequest({ owner, ref, path, name, options, }) { | ||
var _a, _b; | ||
const token = options.token || ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b['GITHUB_TOKEN']); | ||
if (!token) { | ||
throw new Error('You must provide a token to use the GitHub loader'); | ||
} | ||
const headers = { | ||
'content-type': 'application/json; charset=utf-8', | ||
'user-agent': 'graphql-tools', | ||
authorization: `bearer ${token}`, | ||
}; | ||
if (options.token) { | ||
headers['authorization'] = `bearer ${options.token}`; | ||
} | ||
return { | ||
@@ -115,0 +118,0 @@ method: 'POST', |
@@ -102,9 +102,12 @@ import { parseGraphQLSDL, parseGraphQLJSON } from '@graphql-tools/utils'; | ||
prepareRequest({ owner, ref, path, name, options, }) { | ||
var _a, _b; | ||
const token = options.token || ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b['GITHUB_TOKEN']); | ||
if (!token) { | ||
throw new Error('You must provide a token to use the GitHub loader'); | ||
} | ||
const headers = { | ||
'content-type': 'application/json; charset=utf-8', | ||
'user-agent': 'graphql-tools', | ||
authorization: `bearer ${token}`, | ||
}; | ||
if (options.token) { | ||
headers['authorization'] = `bearer ${options.token}`; | ||
} | ||
return { | ||
@@ -111,0 +114,0 @@ method: 'POST', |
{ | ||
"name": "@graphql-tools/github-loader", | ||
"version": "7.3.28-alpha-20230407131203-6663dff6", | ||
"version": "7.3.28-alpha-20230407140332-1a85b75e", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -10,2 +10,4 @@ import { Loader, BaseLoaderOptions, Source } from '@graphql-tools/utils'; | ||
* A GitHub access token | ||
* | ||
* @default process.env.GITHUB_TOKEN | ||
*/ | ||
@@ -12,0 +14,0 @@ token?: string; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15826
331