graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.RQL.Types.ResultCustomization

Synopsis

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.

Constructors

AliasMapping 

Fields

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.

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.