TypeError [ERR_INVALID_ARG_TYPE] when trying to access graphiql #2265
Unanswered
Christopher-Warren
asked this question in
Q&A
Replies: 1 comment 4 replies
-
I think that template needs to be updated. You can check GraphQL Yoga's own Next.js integration recipe and example; I created a PR on Next.js repo to update the example; |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm attempting to get graphql-yoga to work in a preexisting next project.
After using
create-next-app
, i installed bothgraphql-yoga
,graphql
, and copy/pasted the examplepages/api/graphql.ts
from the nextjs examples repo https://github.com/vercel/next.js/tree/canary/examples/api-routes-graphqlI can query the endpoint and get the proper response, but when i visit
http://localhost:3000/api/graphql
in the browser(to access graphiql), the browser hangs, and nextjs throws this error.unhandledRejection: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received type function ([Function (anonymous)])
What really baffles me is when i create a new project using
npx create-next-app --example api-routes-graphql api-routes-graphql-app
, graphiql loads as expected.Can anyone point me in the right direction of figuring this out?
Beta Was this translation helpful? Give feedback.
All reactions