mst-gql icon indicating copy to clipboard operation
mst-gql copied to clipboard

Subscription Generated from Hasura Schema returns no data/is not generated correctly

Open seanaguinaga opened this issue 5 years ago • 1 comments

First - optional params are marked as required:

Screen Shot 2020-08-23 at 7 37 34 AM

https://github.com/seanaguinaga/hasra-mst-gql/blob/master/src/pages/Tab1.tsx

after @ts-ignore

Data is fetched correctly as a query.

Switching to a subscription gives us this:

Screen Shot 2020-08-23 at 7 38 57 AM

Something must've been interpreted incorrectly by mst-gql when creating models?

https://github.com/seanaguinaga/hasra-mst-gql/blob/master/src/models/RootStore.base.ts

The schema generated by hasura is not ideal - but it should work regardless?

https://github.com/seanaguinaga/hasra-mst-gql/blob/master/schema.graphql

Note: the admin secret is temporary - no important data is on this server/db

Did I make a mistake configuring the web socket connection?

https://github.com/seanaguinaga/hasra-mst-gql/blob/master/src/index.tsx

Regardless of misconfiguration - the typedef/lack of data returned by subscribe is wrong? If I am using this wrong - please let me know!

seanaguinaga avatar Aug 23 '20 14:08 seanaguinaga

hi @seanaguinaga! I'll try and take a look at this soon, but we've never used either Hasura or subscriptions in our app so it isn't 100% in my wheelhouse.

The first issue you mention is indeed an issue I hadn't yet run into myself, but I agree that variables should be optional if all its params are optional. I'll open a new issue for that!

chrisdrackett avatar Sep 24 '20 19:09 chrisdrackett