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
I spent a few hours to figure out how to write my own resolver for query / filter involving Union types.
The solution that works for me was something like
let foos = context.mirageSchema.all('foo').models;
for (let foo of foos) {
foo.__typename = 'Foo';
}
let bars = context.mirageSchema.all('bar').models;
for (let bar of bars) {
bar.__typename = 'Bar';
}
return [].concat(foos, bars);
Did I miss something in the documentation?
Should I send a pull request adding this use case to the list of examples?