-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Flow: property $refType is missing in object #2394
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
Comments
@sibelius Oh, that would probably solve my problem. But is it exported outside of the EDIT: I am not sure about that. That won't solve my issue since the |
I am still not sure how to fix the `$refType` issue. See: facebook/relay#2394
@juhaelee I did not. We are just ignoring the errors for now until we find a better solution. I was quite surprised that no one noticed this change so 1) no one upgraded or 2) we are testing it wrong... :) |
@mrmlnc I see, I also seemed to get flow errors on mutations as well ever since the upgrade :/ |
Hey, sorry for not responding here earlier. To unblock your tests for now, you can do something like:
I do think there should be more work done on testability and making the testing more ergonomic. |
My theory for the root cause is the flow type for |
There is actually a workaround described in the relay doc:
To be clear, you need to add fragment Todo_todo on Todo @relay(mask: false) and when using it: ...Todo_todo @relay(mask: false) You will find a working example in this repository. |
this PR could have solved this #2293 try on master |
I am still not sure how to fix the `$refType` issue. See: facebook/relay#2394
Before I switched to TypeScript, I was manually fixing generated types as a workaround. |
@steida By the way, then how did you solved it in TS? I have a generic ( |
@artola Check here https://github.com/este/este |
Check out https://github.com/relayjs/relay-examples/tree/master/todo, @Stephen2 has been working with me to figure out the typing in OSS. The types exported from I'm pretty sure they work as defined in relay iself. We use them all over the place internally. |
Hello. 👋 We use generated Flow types in our functions like this for example:
Problem is that Relay is generating Flow types with
+$refType
:This, unfortunately, complicates our testing because we cannot use simple plain objects (without the
$refType
):I don't really understand why is this property necessary but is it possible to make it at least optional? Or how should we test it properly? It was fine before version 1.5... Error message:
The text was updated successfully, but these errors were encountered: