packages feed

graphql-w-persistent 0.3.0.0 → 0.3.1.0

raw patch · 4 files changed

+29/−27 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ GraphQL: CreatingSqlQueryObjectFieldsException :: QueryException
+ GraphQL: CreatingSqlQueryObjectsException :: QueryException
+ GraphQL: DuplicateRootObjectsException :: QueryException
+ GraphQL: EOFDataProcessingException :: QueryException
+ GraphQL: EmptyQueryException :: QueryException
+ GraphQL: EmptyRowException :: QueryException
+ GraphQL: FailedObjectEqualityException :: QueryException
+ GraphQL: Foundlinebreakexception :: QueryException
+ GraphQL: ImportSchemaDatabaseRelationshipsException :: QueryException
+ GraphQL: ImportSchemaDatabaseTablesException :: QueryException
+ GraphQL: ImportSchemaException :: QueryException
+ GraphQL: ImportSchemaObjectFieldsException :: QueryException
+ GraphQL: ImportSchemaPseudonymsException :: QueryException
+ GraphQL: ImportSchemaScalarFieldsException :: QueryException
+ GraphQL: ImportSchemaServerNameException :: QueryException
+ GraphQL: InvalidArgumentException :: QueryException
+ GraphQL: InvalidAttributeTransformation :: QueryException
+ GraphQL: InvalidObjectException :: QueryException
+ GraphQL: InvalidObjectNestedObjectFieldException :: QueryException
+ GraphQL: InvalidObjectScalarFieldException :: QueryException
+ GraphQL: InvalidObjectSubFieldException :: QueryException
+ GraphQL: InvalidScalarException :: QueryException
+ GraphQL: InvalidVariableNameException :: QueryException
+ GraphQL: InvalidVariableTypeException :: QueryException
+ GraphQL: MismatchedVariableTypeException :: QueryException
+ GraphQL: MissingVariableValueException :: QueryException
+ GraphQL: NullArgumentException :: QueryException
+ GraphQL: ParseFragmentException :: QueryException
+ GraphQL: ReadVariablesException :: QueryException
+ GraphQL: RelationshipConfigurationException :: QueryException
+ GraphQL: SyntaxException :: QueryException
+ GraphQL: TooManyTablesException :: QueryException
+ GraphQL: ValueInterpretationException :: QueryException
+ GraphQL: VariableException :: QueryException
+ GraphQL: VariablesSyntaxException :: QueryException
+ GraphQL: data QueryException

Files

ChangeLog.md view
@@ -14,7 +14,7 @@ 
 ## 0.1.0.3 -- 2018-10-18
 
-* Update documentation and Bug fix
+* Revise documentation and Bug fix
 
 ## 0.1.0.4 -- 2018-10-19
 
@@ -26,20 +26,24 @@ 
 ## 0.1.0.6 -- 2018-10-24
 
-* Update documentation
+* Revise documentation
 
-## 0.1.0.7 -- 2018-10-26
+## 0.1.0.7 -- 2018-10-26 [stable release]
 
-* json file schema - stable
+* Json file schema
 
 ## 0.2.0.0 -- 2018-11-05
 
-* variables are available...api change is schema changes
+* Variables are available...api change is schema changes
 
 ## 0.2.0.1 -- 2018-11-05
 
-* fix to accept empty variable arguments and default values
+* Fix to accept empty variable arguments and default values
 
 ## 0.3.0.0 -- 2018-11-06
 
-* bug-fix to reenable relationship queries and casting returned values with Int, Rationals/Decimals, and Doubles...api change is arguments change to processing data function+* Bug-fix to reenable relationship queries and casting returned values with Int, Rationals/Decimals, and Doubles...api change is arguments change to processing data function
+
+## 0.3.1.0 -- 2018-11-07
+
+* Give thrown exceptions
graphql-w-persistent.cabal view
@@ -10,13 +10,13 @@ -- PVP summary:      +-+------- breaking API changes
 --                   | | +----- non-breaking API additions
 --                   | | | +--- code changes with no API change
-version:             0.3.0.0
+version:             0.3.1.0
 
 -- A short (one-line) description of the package.
 synopsis:            Haskell GraphQL query parser-interpreter-data processor.
 
 -- A longer description of the package.
-description:      This is a general purpose Haskell GraphQL query parser and interpreter middleware. It is including data processing to return GraphQL object formats. The query parser and interpreter are universal (on available database query types which is only SQL for now). It is accepting any string query, and it is returning a list of string database-queries. The data processing unit is designed around the return values from the Yesod and Persistent interface (cast as Text data values from PersistValue). With another server that is same data representation on the returned values from the database, this entire package is applicable. To read more detailed information, you should go to the below module page.
+description:      This is a general purpose Haskell GraphQL query parser and interpreter. It is including data processing to return GraphQL object formats. The query parser and interpreter are universal (on available database query types which is only SQL for now). It is accepting any string query, and it is returning a list of string database-queries. The data processing unit is designed around the return values from the Yesod and Persistent interface (cast as Text data values from PersistValue). With another server that is same data representation on the returned values from the database, this entire package is applicable. To read more detailed information, you should go to the below module page.
 
 -- URL for the project homepage or repository.
 homepage:            https://github.com/jasonsychau/graphql-w-persistent
@@ -37,7 +37,7 @@ -- A copyright notice.
 -- copyright:
 
-category:            Development, Database, Graphs 
+category:            Development, Database, Graphs, Language, Data
 
 build-type:          Simple
 
src/GraphQL.hs view
@@ -20,7 +20,10 @@     module GraphQL,
     -- * Server data types
     -- | These are server data types that are return from processQueryString. You do not need to know these to know how is this package used, but you'll get some insight to what is used to store and organize your GraphQL data.
-    module Model.ServerObjectTypes
+    module Model.ServerObjectTypes,
+    -- * Server exceptions
+    -- | These are server exceptions to make error handling.
+    module Model.ServerExceptions
     ) where
 
 import Data.Text (Text)
@@ -30,6 +33,7 @@ import qualified Components.Parsers.VariablesParser as VP
 import qualified Components.DataProcessors.PersistentDataProcessor as DP
 import Model.ServerObjectTypes
+import Model.ServerExceptions
 import GraphQLHelper
 
 
@@ -162,7 +166,7 @@   
    @"In contrast, GraphQL only returns the data that's explicitly requested, so new capabilities can be added via new types and new fields on those types without creating a breaking change. This has lead to a common practice of always avoiding breaking changes and serving a versionless API."@ - <https://graphql.github.io/learn/best-practices/>
   
-   With respect to that, you should be sure to be explicit with your here representation on your data schema. You should give as much detail as possible (sorry for the bad pun), and you should make adjustments when you feel to evolve your server with your desired schema.   
+   With respect to that, you should be sure to be explicit with your here representation on your data schema. You should give as all planned details, and you should make adjustments when you feel to evolve your server with your desired schema.   
 -}
 processQueryString :: String                        -- ^ GraphQL query argument as String.
                    -> [(String,[String])]           -- ^ unique server object name to list of query reference names.
@@ -295,13 +299,13 @@      __To implement server type heirarchy:__
    
      * add new object to list,
-     * give the intersection scalar fields in the scalarfields argument,
-     * give the intersection object fields in the objectfields argument,
+     * give the children intersection scalar fields in the scalarfields argument,
+     * give the children intersection object fields in the objectfields argument,
      * and add all referring children database table names to the databasetables argument.
 
-     NOTE: You should not need more cases in the databaserelationships argument, but you may find a child database table and object field database table pair that is not included.
+     You should not need more cases in the databaserelationships argument, but you may find a child database table and object field database table pair that is not included.
 
-     The exceptions thrown with this function are same as above function, but there are a few more...
+     The exceptions thrown with this function are same as above function processQueryString, but there are a few more...
 
      * ImportSchemaException (when there is a problem with reading your schema)
      * ImportSchemaServerNameException (when there is a problem with reading your servername argument)
@@ -315,7 +319,7 @@   
    @"In contrast, GraphQL only returns the data that's explicitly requested, so new capabilities can be added via new types and new fields on those types without creating a breaking change. This has lead to a common practice of always avoiding breaking changes and serving a versionless API."@ - <https://graphql.github.io/learn/best-practices/>
   
-   With respect to that, you should be sure to be explicit with your here representation on your data schema. You should give as much detail as possible (sorry for the bad pun), and you should make adjustments when you feel to evolve your server with your desired schema.   
+   With respect to that, you should be sure to be explicit with your here representation on your data schema. You should give all planned details, and you should make adjustments when you feel to evolve your server with your desired schema.   
 -}
 processQueryStringWithJson :: (MonadIO m)
                            => String                       -- ^ This is the GraphQL query
@@ -355,7 +359,7 @@                                                   return $ checkObjectsToSqlWithVariables sss sos sodn sor dvars $ checkStringToObjects svrobjs $ QP.processString qry 
 
 {- |
-    This is the function to call after casting PersistValues to Text from processQueryString.
+    This is the function to call after casting PersistValues to Text from processQueryString of which you may find on my examples <https://github.com/jasonsychau/graphql-w-persistent page>.
     
     The ordered arguments are:
     
@@ -369,10 +373,12 @@ 
     When an error is encountered, an uncaught exception is thrown. The exceptions thrown are of:
 
-    * InvalidObjectException (when server data is misinterpreted)
+    * InvalidObjectException (when server data is misinterpreted or an unrecognized server object is met)
     * InvalidScalarException (when server data is misinterpreted)
     * EOFDataProcessingException (when the given data is shorter than expected in reference to the given serve objects)
     * InvalidArgumentException (when there is an internal argument error - you should not observe this)
+    * InvalidVariableTypeException (when an unrecognized base data type is met)
+    * InvalidObjectScalarFieldException (when an unrecognized object-scalar pair is met)
 -}
 processPersistentData :: [(String,[(String,String)])]  -- ^ unique server object name to list of valid scalar subfields (which are exactly named after database column names) and the subfield type.
                       -> [[[[Text]]]]                  -- ^ database query return value as casted to only Text data types and with no other alterations (a list of GraphQL-grouped results list of SQL query results list of data row lists)
src/Model/ServerExceptions.hs view
@@ -40,12 +40,4 @@                       ValueInterpretationException
   deriving Show
 
-                      -- InvalidObjectNestedObjectFieldException | 
-                      -- InvalidObjectScalarFieldException | 
-                      -- InvalidAttributeTransformation |
-                      -- CreatingSqlQueryObjectsException |
-                      -- TooManyTablesException |
-                      -- EmptyRowException |
-                      -- Foundlinebreakexception |
-
 instance Exception QueryException