jotaijs / jotai-apollo

Apollo graphql client integration for jotai :rocket: :ghost:
MIT License
50 stars 4 forks source link

`atomsWithQuery` optional 2nd parameter isn't optional #8

Open wcardosodev opened 1 year ago

wcardosodev commented 1 year ago

Hey, I've tried following the code example shown in the readme but using my own api and queries etc. In the example of atomsWithQuery it says that the: () => client parameter is optional, however removing that parameter causes app to crash and gives this error: Uncaught ApolloError: Response not successful: Received status code 404

From the docs it looks like the second parameter gets a default client like: getClient: (get: Getter) => ApolloClient<any> = (get) => get(clientAtom)

But I can't see an example of how to set it up so that the default clientAtom has our graphql client