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
{{ message }}
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
Before reporting a bug, please test the beta branch!
Bug description
For now it's pretty hard to use generated classes from "union" type;
For example now, to identify object and use it's field i need to use this construction:
query xxx {
sometype: {
...on X {
onlyXField
}
...on Y {
onlyYField
}
...on Z {
onlyZField
}
}
}
if (parsedObject is X) {
return x.onlyXField;
}
if (parsedObject is Y) {
return y.onlyYField;
}
if (parsedObject is Z) {
return z.onlyZField;
}
// unsupported type
return error;
and if i use mixin (fragments inside queries), then i'd have to:
if (parsedObject is X) {
return (x as XMixin).onlyXField;
}
if (parsedObject is Y) {
return (y as XMixin).onlyYField;
}
if (parsedObject is Z) {
return (z as XMixin).onlyZField;
}
// unsupported type
return error;