Open
Description
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?
Metadata
Metadata
Assignees
Labels
No labels