jotaijs / jotai-apollo

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

atomsWithQuery's status return promise instead of query result (ApolloQueryResult) on first load #13

Open lxcid opened 1 month ago

lxcid commented 1 month ago

I have this wierd bug where it return promise in the first call before it correctly return the query result object (loading, data, etc)

I check the return value of

https://github.com/jotaijs/jotai-apollo/blob/1e34fda90b6a16c2323ab22c7498e70ac48088a9/src/common.ts#L52

that seems to be the behavior.

dai-shi commented 1 month ago

@Aslemammad ?

Aslemammad commented 1 month ago

Hey, just busy here a bit, i'll get to this when I have time!

@dai-shi is it because the new version of jotai?

it'd good to have a repro possibly.

dai-shi commented 1 month ago

If it works differently with a previous version of Jotai, it may be.