-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymorphic Variants capturing a Union with Fragments #215
Comments
Are you sure it's not a nullable field (and the type is not an option?). Otherwise, can you share the schema so we have a reproduction? |
It's not nullable or at least is shouldn't be. Even if it were null though, i find it curious that the console recognizes it as a I've included the file. It's very large. |
Yea sorry if the example is very complex I was upgrading from using reasonml-community/reason-apollo-hooks#117. I'll look into making a minimal example. After talking to @jeddeloh, I think I'm of the mind this may be because of the fact I'm defining the types in I'll keep digging and I'll update if I have a minimal example or if I figure out something that works. |
A little more info I expanded the query out removing the fragment directly inside the union.
I have the same issue, where the fragment are in the incorrect polymorphic variant and I am getting |
Turns out it was something in reason-apollo-client fixed here (jeddeloh/rescript-apollo-client@ff6ec54) I'll close. |
Oh haha oops. Sorry I didn't get around looking into this! |
Hi, I'm using
"reason-apollo-client": "1.0.0-beta.0",
and"@reasonml-community/graphql-ppx": "1.0.1",
and I'm having trouble interpreting unions into polymorphic variants.
Using a
Js.log
, I have an object which looks like the following:With this graphql fragment:
and the polymorphic variant is returning:
Capture through here:
So the polymorphic variant is interpreted as the incorrect type and is returning
undefined
when passed through the switch statement.Do i need a
__typespec
somewhere to inform the union?Is there a working example of unions being evaluated into fragments that i can follow? I believe I had this working in
1.0.0-beta.11
.Thanks
The text was updated successfully, but these errors were encountered: