DustinJSilk / qwik-urql

Urql support for Qwik projects.
MIT License
19 stars 6 forks source link

preview: QWIK ERROR Error: Code(31) s_UTUJN6N3MNA #86

Open bbigras opened 1 year ago

bbigras commented 1 year ago

To reproduce:

git clone https://github.com/bbigras/test-qwik-urql.git
cd test-qwik-urql
npm install
npm run preview

Btw, with npm run dev the code works and fetches data from a public star wars api at https://swapi-graphql.netlify.app/.netlify/functions/index

[...]
✓ Built client modules

> build.preview
> vite build --ssr src/entry.preview.tsx

vite v4.1.1 building SSR bundle for production...
transforming...
✓ 21 modules transformed.
rendering chunks...
server/build/q-e222b46d.css   1.64 kB
server/entry.preview.mjs     50.27 kB
✓ Built preview (ssr) modules
✓ Lint checked

  ➜  Local:   http://localhost:4173/
  ➜  Network: use --host to expose
QWIK ERROR Error: Code(31) s_UTUJN6N3MNA
[Error: Code(31)]
Error: Code(31)

npm: '9.3.1', node: '18.14.0',

bbigras commented 1 year ago

Any ideas?

DustinJSilk commented 1 year ago

Hi @bbigras, Since qwik has changed its API so much since this project started, i was waiting for the new server actions API to be released.

Since then Ive learnt that getting Urql working with Qwik means we have to sacrifice a bunch of great functionality from both Qwik and Urql. They actually solve the same problems.

Using graphql with Qwik should be done as once off requests in an onGet, loader$, or action$. And you should then make use of native Qwik elements to handle prefetching, state, and reactivity.

I havent reach this point yet in my own project as Im first rolling out our static pages, but when I get to it I'll look into a new way to integrate graphql with just loaders, actions, and endpoints, making most of this project redundant.