License | IPS |
---|---|
Maintainer | jasonsychau@live.ca |
Stability | provisional |
Safe Haskell | Safe |
Language | Haskell2010 |
Here is a link to the official documentations. You can learn and get a feel for how can you implement this package.
This is the main module to interpret your queries. The expected query type is a single string to comprise all your GraphQL queries and fragments.
When errors are encountered, this module is simply going to throw an uncaught Exception. The Exception name is some hint to where was the error encountered.
Synopsis
- processQueryString :: String -> [(String, [String])] -> [(String, [String])] -> [(String, [String])] -> [(String, [String])] -> [(String, String, [String])] -> ([RootObject], [[String]])
- processPersistentData :: [[[[Text]]]] -> [RootObject] -> String
- type RootObjects = [RootObject]
- type RootObject = NestedObject
- data NestedObject = NestedObject Alias Name ServerObject SubSelection SubFields
- type Alias = Maybe String
- type ServerObject = String
- type SubSelection = Maybe ScalarType
- type SubFields = [Field]
- type Field = Either ScalarType NestedObject
- data ScalarType = ScalarType Alias Name Transformation Argument
- type Transformation = Maybe String
- type Argument = Maybe String
- type Name = String
Functions
:: String | This is the given GraphQL query. |
-> [(String, [String])] | This is the ServerObject to list of query reference names. |
-> [(String, [String])] | This is the ServerObject to list of valid scalar subfields (which are exactly named after database column names). |
-> [(String, [String])] | This is the ServerObject to list of valid nested object subfields (which are exactly named after the from and to strings within the last function argument). |
-> [(String, [String])] | This is the ServerObject to list of database table names (which are exact references to table names). |
-> [(String, String, [String])] | This is the ServerObject to list of from-to-and intermediate triplet strings as described above to identify all GraphQL relationships with database sequences. |
-> ([RootObject], [[String]]) | The return value is one tuple with server objects and list of grouped sql query strings. |
Function processQueryString: This the function to call to get queries from a GraphQL query. The ordered arguments are: - the GraphQL query as a string - a list of tuple of String and list of String that is unique server object names and all names that are referencing then with any query - a list of tuple of String and list of String that is exact same unique server object names while the list is the valid server object scalar subfields as they are spelt in the database - a list of tuple of String and list of String that is exact same unique server object names while the list is the valid server object nested object subfields as they are referenced in the next list of relationship tables - a list of tuple of String, String, and list of String that is above server object names to make an identity name, a reference name, and a list of String that is identity table, escape identity column name, reference table, arrival reference column name, and an from-to order of intermediate table triplet strings of intermediate table name, intermediate table arrival column name, and intermediate table departure column name The return value is a tuple of server representation objects and a list of list of sql queries. The first list is holding lists that are grouping queries from the same GraphQL query. The inner list is holding the String value sql queries. The server representation objects is later used to format database results to the GraphQL return value syntax.
processPersistentData Source #
:: [[[[Text]]]] | This is the unmodified Persistent database query return value (a list of GraphQL-grouped results list of SQL query results list of data row lists). |
-> [RootObject] | This is the unmodified server objects that was composed from previous processQueryString function. |
-> String | The return value is a string type to describe the GraphQL-organized return values. |
Function processPersistentData: This is the function to call after casting PersistValues to Text from processQueryString. The ordered arguments are: - all the data that is cast to Text type - an unmodified copy of the RootObject list that is returned from processQueryString. The return result is a string to resemble the GraphQL return value.
Server data types
type RootObjects = [RootObject] Source #
These are objects to represent GraphQL query roots.
type RootObject = NestedObject Source #
data NestedObject Source #
NestedObjects are the general object type. They are found as RootObjects or as object Subfields.
Instances
Show NestedObject Source # | |
Defined in Model.ServerObjectTypes showsPrec :: Int -> NestedObject -> ShowS # show :: NestedObject -> String # showList :: [NestedObject] -> ShowS # |
type ServerObject = String Source #
type SubSelection = Maybe ScalarType Source #
type Field = Either ScalarType NestedObject Source #
data ScalarType Source #
ScalarTypes are the other subfield type. They are also found at object attributes.
Instances
Eq ScalarType Source # | |
Defined in Model.ServerObjectTypes (==) :: ScalarType -> ScalarType -> Bool # (/=) :: ScalarType -> ScalarType -> Bool # | |
Show ScalarType Source # | |
Defined in Model.ServerObjectTypes showsPrec :: Int -> ScalarType -> ShowS # show :: ScalarType -> String # showList :: [ScalarType] -> ShowS # |
type Transformation = Maybe String Source #