hasura / hasura/graphql-engine

[regression] Apollo Cache does not work with Actions

Open
#6,831 1 comment 0 reactions 1 assignee Claimed by @eviefp View on GitHub
a/api/graphql a/data c/server support/needs-triage t/server t/server/data
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

I'm currently using Hasura 2.0.0-alpha9 with Apollo Client 3.3.15

All queries, mutations, and subscriptions are working as expected, except for queries to Actions.

I have the following Action:
![Screen Shot 2021-04-27 at 3 40 38 PM](https://user-images.githubusercontent.com/8062245/116302254-f4c93400-a76e-11eb-8a9c-7f429da5a252.png)

The Backend responds with the correct JSON data.

Apollo Query (default) does not work, the `data` and `error` keys are empty (undefined).

This DOES not work
```js
const { loading, data, error } = useQuery(QUERY)
```

This WORKS
```js
const { loading, data, error } = useQuery(QUERY, {
fetchPolicy: 'network-only',
})
```

I'm assuming that Apollo makes the request, stores the data into the cache, reads from the cache, and then responds but it isn't being able to get the data from the cache.

I checked the Network tab and I'm getting the data

![Screen Shot 2021-04-27 at 1 41 51 PM](https://user-images.githubusercontent.com/8062245/116302573-57223480-a76f-11eb-9a7f-db9bcb82810a.png)

I'm also checked it using the `fetch` API
![Screen Shot 2021-04-27 at 1 34 47 PM](https://user-images.githubusercontent.com/8062245/116302616-686b4100-a76f-11eb-85cb-20dc223df2be.png)

And this is from Apollo Chrome extension
![Screen Shot 2021-04-27 at 2 03 35 PM](https://user-images.githubusercontent.com/8062245/116302657-74570300-a76f-11eb-8199-226802ec2a81.png)
![Screen Shot 2021-04-27 at 1 50 09 PM](https://user-images.githubusercontent.com/8062245/116302682-7ae57a80-a76f-11eb-9b99-0453ac8ef4a9.png)

It was working fine in Hasura 1.3.3 but stopped working on 2.0.0, is there something that changed in Actions?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.