resolve :: HetcatsOpts -> Cache -> Text -> Map Text Text -> IO String
resolve opts sessionReference query variables = do
  queryType <- determineQueryType query
  resultM <- case queryType of
    QTSerialization -> case Map.lookup "id" variables of
      Nothing -> fail "Serialization query: Variable \"id\" not provided."
      Just idVar -> SerializationResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTDGraph -> case Map.lookup "locId" variables of
      Nothing -> fail "OMS query: Variable \"locId\" not provided."
      Just idVar -> DGraphResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTOMS -> case Map.lookup "locId" variables of
      Nothing -> fail "OMS query: Variable \"locId\" not provided."
      Just idVar -> OMSResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTSignature -> case Map.lookup "id" variables of
      Nothing -> fail "Signature query: Variable \"id\" not provided."
      Just idVar -> SignatureResolver.resolve opts sessionReference $ read $ Text.unpack idVar
    QTSignatureMorphism -> case Map.lookup "id" variables of
      Nothing -> fail "SignatureMorphism query: Variable \"id\" not provided."
      Just idVar -> SignatureMorphismResolver.resolve opts sessionReference $ read $ Text.unpack idVar
  return $ resultToResponse queryType resultM
resolve :: HetcatsOpts -> Cache -> Text -> Map Text Text -> IO String
resolve opts sessionReference query variables = do
  queryType <- determineQueryType query
  resultM <- case queryType of
    QTSerialization -> case Map.lookup "id" variables of
      Nothing -> fail "Serialization query: Variable \"id\" not provided."
      Just idVar -> SerializationResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTDGraph -> case Map.lookup "locId" variables of
      Nothing -> fail "OMS query: Variable \"locId\" not provided."
      Just idVar -> DGraphResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTOMS -> case Map.lookup "locId" variables of
      Nothing -> fail "OMS query: Variable \"locId\" not provided."
      Just idVar -> OMSResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTSignature -> case Map.lookup "id" variables of
      Nothing -> fail "Signature query: Variable \"id\" not provided."
      Just idVar -> SignatureResolver.resolve opts sessionReference $ read $ Text.unpack idVar
    QTSignatureMorphism -> case Map.lookup "id" variables of
      Nothing -> fail "SignatureMorphism query: Variable \"id\" not provided."
      Just idVar -> SignatureMorphismResolver.resolve opts sessionReference $ read $ Text.unpack idVar
  return $ resultToResponse queryType resultM
resolve opts sessionReference query variables = do
  queryType <- determineQueryType query
  resultM <- case queryType of
    QTSerialization -> case Map.lookup "id" variables of
      Nothing -> fail "Serialization query: Variable \"id\" not provided."
      Just idVar -> SerializationResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTDGraph -> case Map.lookup "locId" variables of
      Nothing -> fail "OMS query: Variable \"locId\" not provided."
      Just idVar -> DGraphResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTOMS -> case Map.lookup "locId" variables of
      Nothing -> fail "OMS query: Variable \"locId\" not provided."
      Just idVar -> OMSResolver.resolve opts sessionReference $ unencloseQuotesAndUnpack idVar
    QTSignature -> case Map.lookup "id" variables of
      Nothing -> fail "Signature query: Variable \"id\" not provided."
      Just idVar -> SignatureResolver.resolve opts sessionReference $ read $ Text.unpack idVar
    QTSignatureMorphism -> case Map.lookup "id" variables of
      Nothing -> fail "SignatureMorphism query: Variable \"id\" not provided."
      Just idVar -> SignatureMorphismResolver.resolve opts sessionReference $ read $ Text.unpack idVar
  return $ resultToResponse queryType resultM