title: How to handle error and send response in GraphQL
body: <p>I was starting with GraphQL and I was unable to comprehend how we can throw errors in GraphQL </p>
  
  <p>I went through a couple of articles on the web but almost all of them use Apollo and the code-structure looks very different than how I work. </p>
  
  <p>Consider this piece of code, here where I am making a mutation, now how can send a response message with error and change headers status message in case of error?</p>
  
  <pre><code>  AddNewPersonalInfo: {
    type: userDashboardType,
    args: { 
      parameter: {
        type: userCreationlInputType
      }
    }, 
    resolve: async (parent, args, context) =&gt; {
      args.parameter.userId = context.req.headers.userId
      //Check if user info already exsist
      const checkIfUserInformationExsist = await getSelectedThingFromTable('CatsWork_personal', 'userId', `${userId}`)
      if (checkIfUserInformationExsist[0]) {
        const error = {
          code: 403, 
          message: 'User info Already exsist'
        }
        throw new Error(error)
      } else {
        try {
        const addLinkedinUser = await insertIntheTable('personal', payload)
        return true
        } catch (err) {
          console.error(err)
          throw new Error(err)
        }
      }
    }
  }
  </code></pre>