bug: Example for Next.js pages Apollo client is failing

Open
#85 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
graphql, nextjs

Research direction

Start with the README and examples/nextjs-pages-router/apollo-client-data-fetch/src/lib/client.js, especially lines 55-60, then run npm run dev without Persisted Queries configured to reproduce the error. Done means the README explains the setup and the example shows how to run without Persisted Queries, with the development command working in both cases.

Written by the indexing model from the issue text.

Description

type:fix

Just a small bug.

If you run npm run dev and you do not have Persisted Queries setup you get the below error:

Image

We should consider updating the README with how to setup persisted queries and also maybe consider adding a commented out example of how to run the example without persisted queries:

See - https://github.com/wpengine/hwptoolkit/blob/main/examples/nextjs-pages-router/apollo-client-data-fetch/src/lib/client.js#L55-L60

const link = new HttpLink({
  uri: WORDPRESS_URL + "/graphql",
  useGETForQueries: true,
});
Dominant language
PHP
Stars
47
Forks
3
Avg merge
1m
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wpengine/hwptoolkit

All issues in wpengine/hwptoolkit

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.