-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use @prismicio/client
v6 internally and update dependencies
#40
Conversation
This can return once ESM is more widely supported.
Codecov Report
@@ Coverage Diff @@
## master #40 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 2
Lines ? 16
Branches ? 3
==========================================
Hits ? 16
Misses ? 0
Partials ? 0 Continue to review full report at Codecov.
|
|
@angeloashmore it integrated well into our project. Just one more thing: although the tsdoc comment mentions that the import { ApolloClient, InMemoryCache } from "@apollo/client";
import { createPrismicLink } from "apollo-link-prismic";
import fetch from "node-fetch";
const apolloClient = new ApolloClient({
link: createPrismicLink({
repositoryName: "YOUR_REPOSITORY_NAME",
// Provide your access token if your repository is secured.
accessToken: "YOUR_ACCESS_TOKEN",
fetch: fetch,
}),
cache: new InMemoryCache(),
}); |
@bencehornak Thanks for trying it out! Good idea about documenting the need to pass a Until those docs are updated, I'll update the README like you suggest. |
@bencehornak If it does, I'll move forward with publishing this as latest. Thanks! |
@angeloashmore now the typing works great as well! One final thought: since this PR brings in breaking changes (e.g. now the fetch argument is required in some environments), wouldn't it be better to bump the major version? (semver #8) |
@bencehornak Correct me if your experience is different, but the current version also requires It isn't documented in the current README or in the code. It uses Apollo's HttpLink internally (as does the updated version), which needs a global or provided So the API should be the same, but it is now explicitly documented in the form of TSDocs and the README (and eventually in the official Prismic docs). |
@prismicio/client
v6 internally along with the most up-to-date dependencies@prismicio/client
v6 internally and update dependencies
@angeloashmore you must be right. (The reason, why I was confused, is that I actually had to add the Anyway, I think this sounds like an edge-case, most users shouldn't experience a breaking change here, so the minor version bump should be fine. |
Thanks for testing it out @bencehornak. This PR is published in |
Types of changes
Description
This PR re-implements
apollo-link-prismic
using@prismicio/client
v6'sgraphqlFetch()
method internally. This simplifies the Link greatly.It also updates all dependencies to the most up-to-date versions.
Lastly, it updates the repository to use the latest Prismic TypeScript project standards.
Fixes: #38
Checklist:
👩🚀