Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 1.2 kB view raw
1// functions to produce objects representing entities => todos, writers, books, stores, employees 2export const makeTodo = i => ({ 3 id: `${i}`, 4 text: `Todo ${i}`, 5 complete: false, 6}); 7export const makeWriter = i => ({ 8 id: `${i}`, 9 name: `Writer ${i}`, 10 amountOfBooks: Math.random() * 100, 11 recognized: Boolean(i % 2), 12 number: i, 13 interests: 'Dragonball-Z', 14}); 15export const makeBook = i => ({ 16 id: `${i}`, 17 title: `Book ${i}`, 18 published: Boolean(i % 2), 19 genre: 'Fantasy', 20 rating: (i / Math.random()) * 100, 21}); 22export const makeStore = i => ({ 23 id: `${i}`, 24 name: `Store ${i}`, 25 country: 'USA', 26}); 27export const makeEmployee = i => ({ 28 id: `${i}`, 29 name: `Employee ${i}`, 30 origin: 'USA', 31}); 32export const makeAuthor = i => ({ 33 id: `${i}`, 34 name: `Author ${i}`, 35 recognized: Boolean(i % 2), 36 book: { 37 id: `${i}`, 38 title: `Book ${i}`, 39 published: Boolean(i % 2), 40 genre: `Non-Fiction`, 41 rating: (i / Math.random()) * 100, 42 review: { 43 id: `${i}`, 44 score: i, 45 name: `Review ${i}`, 46 reviewer: { 47 id: `${i}`, 48 name: `Person ${i}`, 49 verified: Boolean(i % 2), 50 }, 51 }, 52 }, 53});