You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I appreciate your work, and I believe there's an opportunity to enhance the handling of interface.
Currently, when handling an interface, it generates a variant if there is only an inline fragment. However, it does not generate a variant when using the refetchable directive.
moduleBookFragment= %relay(` fragment MyComponent_book on Book { ... on Textbook { title courses { name } } ... on ColoringBook { title colors } }`)
...letbook=BookFragment.use(book)
// `book` would roughly be:// type fragment = [// | TextBook({ title: string, courses: array<course> })// | ColoringBook({ title: string, colors: array<string> })// | UnselectedUnionMember(string)// ]
However, with the refetchable directive, it generates:
moduleBookFragment= %relay(` fragment MyComponent_book on Book @refetchable(queryName: "Book_Fragment_RefetchQuery"){ ... on Textbook { title courses { name } } ... on ColoringBook { title colors } }`)
letbook=BookFragment.useRefetchable(book)
// `book` would roughly be:// type fragment = {// title: string,// courses: option<array<course>>,// colors: option<array<string>>// }
I'm not certain if this behavior is due to the way types are handled by Relay, I hope we can improve this aspect as well!
The text was updated successfully, but these errors were encountered:
Hello, I appreciate your work, and I believe there's an opportunity to enhance the handling of interface.
Currently, when handling an interface, it generates a variant if there is only an inline fragment. However, it does not generate a variant when using the refetchable directive.
This issue is related to ##315
Without refetchable directive, it generates:
However, with the refetchable directive, it generates:
I'm not certain if this behavior is due to the way types are handled by Relay, I hope we can improve this aspect as well!
The text was updated successfully, but these errors were encountered: