react-apollo
react-apollo copied to clipboard
:recycle: React integration for Apollo Client
**Intended outcome:** The useQuery hook fires. If the GQL results in error, I use a library to raise a toast notification inside of Apollo client's onError callback. This should not...
**Intended outcome:** Here is a brief, minimal outline of the inside of a React functional component I have: ```js const { refetch } = useQuery(MY_QUERY, { variables: { myVar },...
When running `@apollo/client` on the server the queries are not resolved before rendering static. When checking out `getMarkupFromTree` I noticed that the following code returns false: ``` return renderPromises.hasPromises() ?...
Hello! I had this code before updating to v3: ```javascript const { data: dataEvents, loading: loadingEvents, error: errorEvents, } = useQuery( getEventsQuery, { fetchPolicy: "network-only", onCompleted() { //do stuffs }...
**Intended outcome:** Using the `skip` property of `useQuery`, I expect the query not to be executed as long as `skip === true`. **Actual outcome:** No matter which value `skip` has,...
**Intended outcome:** Keep my test passing when upgrading `@apollo/react-hooks` from 3.1.3 to 3.1.5. **Actual outcome:** A bunch of tests started failing. I traced it down to usages of `useLazyQuery` +...
Data from mocked result in MockProvider is not passed to `onCompleted` callback. I have component like this: ``` function Dogs({ onDogSelected }) { const [options, setOptions] = useState([]); const [fetch,...
**Intended outcome:** According to the docs section - https://www.apollographql.com/docs/react/api/apollo-client/#optional-fields `defaultOptions` provides application-wide default values for options. So by providing the following code: ```js const client = new ApolloClient({ ..., defaultOptions:...
**Intended outcome:** After upgrading typescript to `3.8.2` I started to get a compile error: ``` TS2322: Type '({ data, loading, error }: { data: any; loading: any; error: any; })...
Hey people, whenever I'm using useQuery on my application, the first query that I left below results on data as undefined (and no error either on Network level, nor on...