timhall / svelte-apollo

Svelte integration for Apollo GraphQL
MIT License
947 stars 68 forks source link

Compatible with svelte@next? #75

Open janosh opened 3 years ago

janosh commented 3 years ago

If I run

mkdir svelte-next && cd svelte-next && npm init svelte@next && npm i && npm i -D svelte-apollo

and then try to import setClient

<script>
  import Counter from "$components/Counter.svelte";
  import { setClient } from "svelte-apollo";
</script>

in index.svelte, I get

500 Failed to resolve module specifier "process". Relative references must start with either "/", "./", or "../".

Can this be worked around or does svelte-apollo need an update to be used with svelte@next?

georgecrawford commented 3 years ago

I don't really know what I'm doing, but I think this tip has helped: https://github.com/snowpackjs/snowpack/discussions/1477#discussioncomment-122780

riez commented 3 years ago

did you able to get this working on svelte@next? i'm still trying to findout how to implement graphql client on it..

janosh commented 3 years ago

@riez Nope, I ended up using simple fetch requests to my GraphQL endpoint instead of an Apollo client. No caching that way, but I'm requesting relatively small amounts of data anyway.

riez commented 3 years ago

I see .. I was thinking to implementing that way too.. but right now I'm trying another package before that..