Skip to content

Instantly share code, notes, and snippets.

@taras
Last active August 19, 2022 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taras/b6196c0ac6365f6820b3d4b21cc9f944 to your computer and use it in GitHub Desktop.
Save taras/b6196c0ac6365f6820b3d4b21cc9f944 to your computer and use it in GitHub Desktop.
type Person {
name: String
accounts: [Account]
}
type Account {
owner: Person! @inverse(of: "Person.accounts")
}
factory.create("Account", {
owner: {
name: "Tom"
}
});
factory.create("Account", {
owner: {
name: "Tom"
}
});
const people = [...factory.all("Person")];
const accounts = [...factory.all("Account")];
expect(people).toHaveLength(1);
expect(accounts).toHaveLength(2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment