Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype AliasMapping = AliasMapping {
- unAliasMapping :: Name -> Name
- singletonAliasMapping :: Name -> Name -> AliasMapping
- newtype ResultCustomizer = ResultCustomizer {
- unResultCustomizer :: AliasMapping -> Value -> Value
- applyResultCustomizer :: ResultCustomizer -> Value -> Value
- applyAliasMapping :: AliasMapping -> ResultCustomizer -> ResultCustomizer
- modifyFieldByName :: Name -> ResultCustomizer -> ResultCustomizer
- customizeTypeNameString :: HashMap Name Name -> ResultCustomizer
Documentation
newtype AliasMapping Source #
Mapping that can be provided to a ResultCustomizer to map top-level field aliases that were not available at field parse time. E.g. for aliases created in the remote server query for remote joins.
AliasMapping | |
|
Instances
Semigroup AliasMapping Source # | |
Defined in Hasura.RQL.Types.ResultCustomization (<>) :: AliasMapping -> AliasMapping -> AliasMapping # sconcat :: NonEmpty AliasMapping -> AliasMapping # stimes :: Integral b => b -> AliasMapping -> AliasMapping # | |
Monoid AliasMapping Source # | |
Defined in Hasura.RQL.Types.ResultCustomization mempty :: AliasMapping # mappend :: AliasMapping -> AliasMapping -> AliasMapping # mconcat :: [AliasMapping] -> AliasMapping # |
singletonAliasMapping :: Name -> Name -> AliasMapping Source #
AliasMapping that maps a single field name to an alias
newtype ResultCustomizer Source #
Function to modify JSON values returned from the remote server e.g. to map values of __typename fields to customized type names. The customizer uses Maybe to allow short-circuiting subtrees where no customizations are needed.
Instances
Semigroup ResultCustomizer Source # | |
Defined in Hasura.RQL.Types.ResultCustomization (<>) :: ResultCustomizer -> ResultCustomizer -> ResultCustomizer # sconcat :: NonEmpty ResultCustomizer -> ResultCustomizer # stimes :: Integral b => b -> ResultCustomizer -> ResultCustomizer # | |
Monoid ResultCustomizer Source # | |
Defined in Hasura.RQL.Types.ResultCustomization |
applyResultCustomizer :: ResultCustomizer -> Value -> Value Source #
Apply a ResultCustomizer to a JSON value
applyAliasMapping :: AliasMapping -> ResultCustomizer -> ResultCustomizer Source #
Apply an AliasMapping to a ResultCustomizer.
modifyFieldByName :: Name -> ResultCustomizer -> ResultCustomizer Source #
Take a ResultCustomizer for a JSON subtree, and a fieldName, and produce a ResultCustomizer for a parent object or array of objects that applies the subtree customizer to the subtree at the given fieldName.
customizeTypeNameString :: HashMap Name Name -> ResultCustomizer Source #
Create a RemoteResultCustomizer that applies the typeNameMap to a JSON string value, e.g. for use in customizing a __typename field value.