Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hasura.QueryTags
Description
This module has the various metadata we want to attach to the generated/executed query
Synopsis
- data QueryTags
- newtype QueryTagsComment = QueryTagsComment {}
- type Attribute = (Text, Text)
- data QueryTagsAttributes
- emptyQueryTagsAttributes :: QueryTagsAttributes
- emptyQueryTagsComment :: QueryTagsComment
- data QueryMetadata = QueryMetadata (Maybe RequestId) (Maybe Name) RootFieldAlias ParameterizedQueryHash
- data MutationMetadata = MutationMetadata (Maybe RequestId) (Maybe Name) RootFieldAlias ParameterizedQueryHash
- data LivequeryMetadata = LivequeryMetadata RootFieldAlias ParameterizedQueryHash
- encodeQueryTags :: QueryTags -> QueryTagsAttributes
- class Monad m => MonadQueryTags m where
Documentation
Query Tags are SQL comments which are made up of (key=value) pairs.
These are appended to the SQL statements generated by Hasura for GraphQL operations. This enables the ability to get some application context in the database logs and also use native database monitoring tools (e.g. pganalyze) for better performance analysis.
The application context(query tags) can be used to detect slow GQL operation and relate them back to the SQL that was generated.
For eg: SELECT name FROM child * request_id=487c2ed5-08a4-429a-b0e0-4666a82e3cc6, field_name=child, operation_name=GetChild *
For more usage information, refer Query Tags Docs
Constructors
QTQuery !QueryMetadata | |
QTMutation !MutationMetadata | |
QTLiveQuery !LivequeryMetadata |
newtype QueryTagsComment Source #
query-tags as SQL comment which is appended to the prepared SQL statement
Constructors
QueryTagsComment | |
Fields |
Instances
Show QueryTagsComment Source # | |
Defined in Hasura.QueryTags Methods showsPrec :: Int -> QueryTagsComment -> ShowS # show :: QueryTagsComment -> String # showList :: [QueryTagsComment] -> ShowS # | |
Eq QueryTagsComment Source # | |
Defined in Hasura.QueryTags Methods (==) :: QueryTagsComment -> QueryTagsComment -> Bool # (/=) :: QueryTagsComment -> QueryTagsComment -> Bool # |
data QueryTagsAttributes Source #
Instances
Show QueryTagsAttributes Source # | |
Defined in Hasura.QueryTags Methods showsPrec :: Int -> QueryTagsAttributes -> ShowS # show :: QueryTagsAttributes -> String # showList :: [QueryTagsAttributes] -> ShowS # | |
Eq QueryTagsAttributes Source # | |
Defined in Hasura.QueryTags Methods (==) :: QueryTagsAttributes -> QueryTagsAttributes -> Bool # (/=) :: QueryTagsAttributes -> QueryTagsAttributes -> Bool # |
data QueryMetadata Source #
Constructors
QueryMetadata (Maybe RequestId) (Maybe Name) RootFieldAlias ParameterizedQueryHash |
Instances
Show QueryMetadata Source # | |
Defined in Hasura.QueryTags Methods showsPrec :: Int -> QueryMetadata -> ShowS # show :: QueryMetadata -> String # showList :: [QueryMetadata] -> ShowS # |
data MutationMetadata Source #
Constructors
MutationMetadata (Maybe RequestId) (Maybe Name) RootFieldAlias ParameterizedQueryHash |
Instances
Show MutationMetadata Source # | |
Defined in Hasura.QueryTags Methods showsPrec :: Int -> MutationMetadata -> ShowS # show :: MutationMetadata -> String # showList :: [MutationMetadata] -> ShowS # |
data LivequeryMetadata Source #
Constructors
LivequeryMetadata RootFieldAlias ParameterizedQueryHash |
Instances
Show LivequeryMetadata Source # | |
Defined in Hasura.QueryTags Methods showsPrec :: Int -> LivequeryMetadata -> ShowS # show :: LivequeryMetadata -> String # showList :: [LivequeryMetadata] -> ShowS # |
class Monad m => MonadQueryTags m where Source #
Minimal complete definition
Nothing
Methods
createQueryTags :: QueryTagsAttributes -> Maybe QueryTagsConfig -> Tagged m QueryTagsComment Source #
Creates Query Tags. These are appended to the Generated SQL. Helps users to use native database monitoring tools to get some 'application-context'.
default createQueryTags :: forall t n. (m ~ t n, MonadQueryTags n) => QueryTagsAttributes -> Maybe QueryTagsConfig -> Tagged m QueryTagsComment Source #