diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -46,4 +46,8 @@
 
 ## 0.3.1.0 -- 2018-11-07
 
-* Give thrown exceptions
+* Give thrown exceptions
+
+## 0.3.1.1 -- 2018-11-07
+
+* bug fix: processing sql data was incorrect from object to nested object with generalized database entities, though this is now fixed.
diff --git a/graphql-w-persistent.cabal b/graphql-w-persistent.cabal
--- a/graphql-w-persistent.cabal
+++ b/graphql-w-persistent.cabal
@@ -10,7 +10,7 @@
 -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.3.1.0
+version:             0.3.1.1
 
 -- A short (one-line) description of the package.
 synopsis:            Haskell GraphQL query parser-interpreter-data processor.
diff --git a/src/Components/DataProcessors/PersistentDataProcessor.hs b/src/Components/DataProcessors/PersistentDataProcessor.hs
--- a/src/Components/DataProcessors/PersistentDataProcessor.hs
+++ b/src/Components/DataProcessors/PersistentDataProcessor.hs
@@ -21,7 +21,9 @@
 -- with SubFields and data rows, we want json representation on qraphql query data
 processSubFields :: [(String,[(String,String)])] -> String -> [Field] -> [[[Text]]] -> [JSValue]
 processSubFields _ _ _ [] = []
-processSubFields sss sobj sfs rlts = foldr (\x y -> x++y) [] [((showJSON $ toJSObject $ composeGraphQlRow sss sobj sfs $ fetchGraphQlRow typ):(processSubFields sss sobj sfs [removeDataRow typ])) |typ<-rlts,(length typ)>0]
+processSubFields sss sobj sfs rlts = if length(qryData)>0 then ((showJSON $ toJSObject $ composeGraphQlRow sss sobj sfs $ fetchGraphQlRow qryData):(processSubFields sss sobj sfs [removeDataRow qryData])) else []
+                                        where
+                                            qryData = foldr (\x y -> x++y) [] rlts
 composeGraphQlRow :: [(String,[(String,String)])] -> String -> [Field] -> [[Text]] -> [(String,JSValue)]
 composeGraphQlRow _ _ [] ([]:t) = [] -- done
 -- composeGraphQlRow _ _ _ [] = [] -- no data
@@ -34,9 +36,9 @@
     nestedObjectFieldCount = (countNestedObjectQueriedFields $ fromRight (E.throw InvalidObjectException) a)
     scalarField = (fromLeft (E.throw InvalidScalarException) a)
 fetchGraphQlRow :: [[Text]] -> [[Text]]
-fetchGraphQlRow rlts = [t | (h:t)<-rlts, (h)==(head $ head rlts)]
+fetchGraphQlRow rlts = [t | (h:t)<-rlts, ((h)==(head $ head rlts))&&((head t)==(head $ tail $ head rlts))]
 removeDataRow :: [[Text]] -> [[Text]]
-removeDataRow rlts = [x | x<-rlts, (head x)/=(head $ head rlts)]
+removeDataRow rlts = [x | x<-rlts, (head x)/=(head $ head rlts)||((head $ tail x)/=(head $ tail $ head rlts))]
 getScalarFieldLabel :: ScalarType -> String
 getScalarFieldLabel (ScalarType alias name trans arg) = if (alias/=Nothing) then (fromJust alias) else name
 getScalarFieldName :: ScalarType -> String
