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

Hasura.RQL.Types.Relationships.ToSource

Synopsis

Documentation

data ToSourceRelationshipDef Source #

Metadata representation of a "remote" relationship targetting a source.

This representation has to be backend-agnostic, as it will be parsed before the source cache is built, meaning we can't decide how something backend specific should be resolved based solely on the source name. But the table name is specific to the targeted backend... There are two solutions to this problem: - we can either include an additional field in the serialization that tells us the "kind" of the backend; but that requies an additional field that is technically not required, and that could potentially be inconsistent - or we can do the same thing that we do for source to source relationships: we store an unparsed JSON value as far as the metadata goes, and we parse it when building the schema cache, when we know the kind of the source from its name We chose the latter.

Furthermore, the mapping is represented using a backend-agnostic FieldName, whose interpretation is likewise delayed until the schema cache is built.

FIXME: move this to Hasura/Metadata

Instances

Instances details
Eq ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Show ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Generic ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Associated Types

type Rep ToSourceRelationshipDef :: Type -> Type #

NFData ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Methods

rnf :: ToSourceRelationshipDef -> () #

FromJSON ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Methods

parseJSON :: Value -> Parser ToSourceRelationshipDef

parseJSONList :: Value -> Parser [ToSourceRelationshipDef]

ToJSON ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Cacheable ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

type Rep ToSourceRelationshipDef Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

type Rep ToSourceRelationshipDef = D1 ('MetaData "ToSourceRelationshipDef" "Hasura.RQL.Types.Relationships.ToSource" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ToSourceRelationshipDef" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_tsrdRelationshipType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RelType) :*: S1 ('MetaSel ('Just "_tsrdFieldMapping") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HashMap FieldName FieldName))) :*: (S1 ('MetaSel ('Just "_tsrdSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourceName) :*: S1 ('MetaSel ('Just "_tsrdTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value))))

data RemoteSourceFieldInfo tgt Source #

Schema cache information for a table field targeting a remote source.

Constructors

RemoteSourceFieldInfo 

Fields

Instances

Instances details
Backend tgt => Eq (RemoteSourceFieldInfo tgt) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Generic (RemoteSourceFieldInfo tgt) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

Associated Types

type Rep (RemoteSourceFieldInfo tgt) :: Type -> Type #

Backend tgt => Cacheable (RemoteSourceFieldInfo tgt) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

type Rep (RemoteSourceFieldInfo tgt) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.ToSource

type Rep (RemoteSourceFieldInfo tgt) = D1 ('MetaData "RemoteSourceFieldInfo" "Hasura.RQL.Types.Relationships.ToSource" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RemoteSourceFieldInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_rsfiName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RelName) :*: (S1 ('MetaSel ('Just "_rsfiType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RelType) :*: S1 ('MetaSel ('Just "_rsfiSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourceName))) :*: ((S1 ('MetaSel ('Just "_rsfiSourceConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SourceConfig tgt)) :*: S1 ('MetaSel ('Just "_rsfiSourceCustomization") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourceTypeCustomization)) :*: (S1 ('MetaSel ('Just "_rsfiTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TableName tgt)) :*: S1 ('MetaSel ('Just "_rsfiMapping") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HashMap FieldName (ScalarType tgt, Column tgt)))))))