diff --git a/packages/testing/addon/mirage-graphql/filters/base.js b/packages/testing/addon/mirage-graphql/filters/base.js index 517f8c91b..a9c3f776a 100644 --- a/packages/testing/addon/mirage-graphql/filters/base.js +++ b/packages/testing/addon/mirage-graphql/filters/base.js @@ -98,4 +98,16 @@ export default class BaseFilter { btoa(`${this.type}:${slug}`) === value, ); } + + ids(records, value) { + if (value === undefined || value === null) { + return []; + } + + return records.filter(({ id, slug }) => + [id, slug, btoa(`${this.type}:${id}`), btoa(`${this.type}:${slug}`)].some( + (v) => value.includes(v), + ), + ); + } }