Skip to content

sample state

Darian Chen edited this page Oct 9, 2022 · 5 revisions
{entities {
  users: {
      1: {
        id: 1,
        displayName: "Prashanth Chandrasekar",
        email: "prashanthchandrasekar@example.com",
        aboutMe: "Hello World!",
        reputation: 100                 
      },
      2: {
        id: 2,
        displayName: "Alan Turing",
        email: "alanturing@example.com",
        aboutMe: "Computer science rocks!",
        reputation: 200                     
      },
      3: {
        id: 3,
        displayName: "John von Neumann",
        email: "johnvonneumann@example.com,
        aboutMe: "I am a genius!",
        reputation: 700       
      }
   },
   questions: {
       1:{ 
         id: 1,
         views: 1000,
         authorId: 1,
         tagIds: [1],
         commentIds: 1,
         voteIds: 1,
         title: "How do you print something to the console on JavaScript?",
         body: "I have been stuck on this for over an hour!"
       },
       2: { 
         id: 2,
         views: 1000,
         authorId: 2,
         tagIds: [1, 2],
         commentIds: 2,
         voteIds: 2,
         title: "Why is React so hard?",
         body: "I can't understand it at all!"
       }
   },
   answers: {
       10: {
         id: 11,      
         answererId: 2,
         questionId: 1,
         commentIds: [5],
         vote_ids: [3],
         body: "You just have to use console.log() dummy!"      
       },
       20: {
         id: 12,      
         answererId: 3,
         questionId: 2,
         commentIds: [6],
         voteIds: [4],
         body: "Cuz you aren't trying hard enough!"  
       }
   },
   tags: {
       1: {
         id: 1,
	 name: "JavaScript"      
       },
       2: {
         id: 2,      
         name: "React"
       }
   },
   taggings: {
       1: {
         id: 1,
         tagId: 1,
         questionId: 1
       }
   },
   badges: {
       1: {
         id: 1,
	 name: "Nice Question"
	 description: "Question score of 10 or more"      
       }
   },
   user_badges: {
       1: {
         id: 1,
         badgeId: 1,
         userId: 1
       }
   },
   ui: {
     loading: true/false,
     modal: true/false
   },
   session: { 
     currentUserId: 1, 
   },
   errors: {
     login: ["Incorrect email/password combination"]
   }
}
Clone this wiki locally