@draftbit/auth-schema-link
Advanced tools
Comparing version
12
index.js
const fetch = require("node-fetch"); | ||
const { HttpLink } = require("apollo-link-http"); | ||
const { makeRemoteExecutableSchema, introspectSchema } = require("graphql-tools"); | ||
const { setContext } = require("apollo-link-context"); | ||
async function getAuthSchema() { | ||
const link = new HttpLink({ | ||
async function getAuthSchema({ baseId, apiKey }) { | ||
const http = new HttpLink({ | ||
uri: "https://auth.draftbit.com", | ||
@@ -11,2 +12,9 @@ fetch | ||
const link = setContext((request, previousContext) => ({ | ||
headers: { | ||
"draftbit-base-id": baseId, | ||
"draftbit-api-key": apiKey | ||
} | ||
})).concat(http); | ||
const remoteSchema = await introspectSchema(link); | ||
@@ -13,0 +21,0 @@ const remoteAuthSchema = makeRemoteExecutableSchema({ |
{ | ||
"name": "@draftbit/auth-schema-link", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"apollo-link-context": "^1.0.19", | ||
"apollo-link-http": "^1.5.15", | ||
@@ -8,0 +9,0 @@ "graphql-tools": "^4.0.5", |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6952
24.65%23
43.75%4
33.33%2
100%+ Added
+ Added