Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
newtype QueryTagsComment Source #
query-tags as SQL comment which is appended to the prepared SQL statement
Instances
Show QueryTagsComment Source # | |
Defined in Hasura.QueryTags showsPrec :: Int -> QueryTagsComment -> ShowS # show :: QueryTagsComment -> String # showList :: [QueryTagsComment] -> ShowS # | |
Eq QueryTagsComment Source # | |
Defined in Hasura.QueryTags (==) :: QueryTagsComment -> QueryTagsComment -> Bool # (/=) :: QueryTagsComment -> QueryTagsComment -> Bool # |
data QueryTagsAttributes Source #
Instances
Show QueryTagsAttributes Source # | |
Defined in Hasura.QueryTags showsPrec :: Int -> QueryTagsAttributes -> ShowS # show :: QueryTagsAttributes -> String # showList :: [QueryTagsAttributes] -> ShowS # | |
Eq QueryTagsAttributes Source # | |
Defined in Hasura.QueryTags (==) :: QueryTagsAttributes -> QueryTagsAttributes -> Bool # (/=) :: QueryTagsAttributes -> QueryTagsAttributes -> Bool # |
data QueryMetadata Source #
Instances
Show QueryMetadata Source # | |
Defined in Hasura.QueryTags showsPrec :: Int -> QueryMetadata -> ShowS # show :: QueryMetadata -> String # showList :: [QueryMetadata] -> ShowS # |
data MutationMetadata Source #
Instances
Show MutationMetadata Source # | |
Defined in Hasura.QueryTags showsPrec :: Int -> MutationMetadata -> ShowS # show :: MutationMetadata -> String # showList :: [MutationMetadata] -> ShowS # |
data LivequeryMetadata Source #
Instances
Show LivequeryMetadata Source # | |
Defined in Hasura.QueryTags showsPrec :: Int -> LivequeryMetadata -> ShowS # show :: LivequeryMetadata -> String # showList :: [LivequeryMetadata] -> ShowS # |
class Monad m => MonadQueryTags m where Source #
Nothing
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 #
Instances
MonadQueryTags AppM Source # | |
Defined in Hasura.App | |
MonadQueryTags m => MonadQueryTags (CacheRWT m) Source # | |
Defined in Hasura.RQL.DDL.Schema.Cache | |
MonadQueryTags m => MonadQueryTags (MetadataT m) Source # | |
Defined in Hasura.RQL.Types.SchemaCache.Build | |
MonadQueryTags m => MonadQueryTags (Handler m) Source # | |
Defined in Hasura.Server.App | |
MonadQueryTags m => MonadQueryTags (ExceptT e m) Source # | |
Defined in Hasura.QueryTags createQueryTags :: QueryTagsAttributes -> Maybe QueryTagsConfig -> Tagged (ExceptT e m) QueryTagsComment Source # | |
MonadQueryTags m => MonadQueryTags (ReaderT r m) Source # | |
Defined in Hasura.QueryTags createQueryTags :: QueryTagsAttributes -> Maybe QueryTagsConfig -> Tagged (ReaderT r m) QueryTagsComment Source # |