Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data AliasMapping
- singletonAliasMapping :: Name -> Name -> AliasMapping
- data ResultCustomizer
- applyResultCustomizer :: ResultCustomizer -> Value -> Value
- applyAliasMapping :: AliasMapping -> ResultCustomizer -> ResultCustomizer
- modifyFieldByName :: Name -> ResultCustomizer -> ResultCustomizer
- customizeTypeNameString :: HashMap Name Name -> ResultCustomizer
Documentation
data 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.
Instances
Monoid AliasMapping Source # | |
Defined in Hasura.RQL.Types.ResultCustomization mempty :: AliasMapping # mappend :: AliasMapping -> AliasMapping -> AliasMapping # mconcat :: [AliasMapping] -> AliasMapping # | |
Semigroup AliasMapping Source # | |
Defined in Hasura.RQL.Types.ResultCustomization (<>) :: AliasMapping -> AliasMapping -> AliasMapping # sconcat :: NonEmpty AliasMapping -> AliasMapping # stimes :: Integral b => b -> AliasMapping -> AliasMapping # |
singletonAliasMapping :: Name -> Name -> AliasMapping Source #
AliasMapping that maps a single field name to an alias
data 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
Monoid ResultCustomizer Source # | |
Defined in Hasura.RQL.Types.ResultCustomization | |
Semigroup ResultCustomizer Source # | |
Defined in Hasura.RQL.Types.ResultCustomization (<>) :: ResultCustomizer -> ResultCustomizer -> ResultCustomizer # sconcat :: NonEmpty ResultCustomizer -> ResultCustomizer # stimes :: Integral b => b -> ResultCustomizer -> ResultCustomizer # | |
Show ResultCustomizer Source # | |
Defined in Hasura.RQL.Types.ResultCustomization showsPrec :: Int -> ResultCustomizer -> ShowS # show :: ResultCustomizer -> String # showList :: [ResultCustomizer] -> ShowS # |
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.