apollo-link-prismic
Advanced tools
Comparing version 1.1.0-alpha.0 to 1.1.0-alpha.1
@@ -0,7 +1,7 @@ | ||
import { getRepositoryName, getGraphQLEndpoint, getRepositoryEndpoint, createClient } from '@prismicio/client'; | ||
import { createHttpLink } from '@apollo/client/core'; | ||
import { getGraphQLEndpoint, getEndpoint, createClient } from '@prismicio/client'; | ||
const createPrismicLink = (config) => { | ||
const { | ||
repositoryName, | ||
repositoryName: providedRepositoryName, | ||
fetch, | ||
@@ -13,4 +13,8 @@ accessToken, | ||
} = config; | ||
let repositoryName = providedRepositoryName; | ||
if (!repositoryName && providedURI) { | ||
repositoryName = getRepositoryName(providedURI); | ||
} | ||
const uri = providedURI || getGraphQLEndpoint(repositoryName); | ||
const apiEndpoint = providedApiEndpoint || getEndpoint(repositoryName); | ||
const apiEndpoint = providedApiEndpoint || getRepositoryEndpoint(repositoryName); | ||
const client = createClient(apiEndpoint, { | ||
@@ -17,0 +21,0 @@ fetch, |
{ | ||
"name": "apollo-link-prismic", | ||
"version": "1.1.0-alpha.0", | ||
"version": "1.1.0-alpha.1", | ||
"description": "Apollo link for Prismic", | ||
@@ -51,3 +51,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@prismicio/client": "^6.2.0" | ||
"@prismicio/client": "^6.3.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "devDependencies": { |
import type { ApolloLink, HttpOptions } from "@apollo/client/core"; | ||
import type { FetchLike } from "@prismicio/client"; | ||
import { FetchLike, getRepositoryName } from "@prismicio/client"; | ||
import { createHttpLink } from "@apollo/client/core"; | ||
import { | ||
getEndpoint, | ||
getRepositoryEndpoint, | ||
getGraphQLEndpoint, | ||
@@ -75,3 +75,3 @@ createClient, | ||
const { | ||
repositoryName, | ||
repositoryName: providedRepositoryName, | ||
fetch, | ||
@@ -84,4 +84,11 @@ accessToken, | ||
let repositoryName = providedRepositoryName; | ||
if (!repositoryName && providedURI) { | ||
repositoryName = getRepositoryName(providedURI); | ||
} | ||
const uri = providedURI || getGraphQLEndpoint(repositoryName); | ||
const apiEndpoint = providedApiEndpoint || getEndpoint(repositoryName); | ||
const apiEndpoint = | ||
providedApiEndpoint || getRepositoryEndpoint(repositoryName); | ||
@@ -88,0 +95,0 @@ const client = createClient(apiEndpoint, { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
29455
231
2
Updated@prismicio/client@^6.3.0