Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type RemoteRelationship = RemoteRelationshipG RemoteRelationshipDefinition
- data RRFormat
- data RemoteSourceRelationshipBuilder
- data RemoteRelationshipDefinition
- data RRParseMode
- parseRemoteRelationshipDefinition :: RRParseMode -> Value -> Parser RemoteRelationshipDefinition
- data RemoteFieldInfo lhsJoinField = RemoteFieldInfo {
- _rfiLHS :: HashMap FieldName lhsJoinField
- _rfiRHS :: RemoteFieldInfoRHS
- data RemoteFieldInfoRHS
- data DBJoinField (b :: BackendType)
- = JoinColumn (Column b) (ColumnType b)
- | JoinComputedField (ScalarComputedField b)
- data ScalarComputedField (b :: BackendType) = ScalarComputedField {}
- tableNameToLHSIdentifier :: Backend b => TableName b -> LHSIdentifier
- _RelationshipToSchema :: Prism' RemoteRelationshipDefinition (RRFormat, ToSchemaRelationshipDef)
- _RelationshipToSource :: Prism' RemoteRelationshipDefinition ToSourceRelationshipDef
Documentation
Represents the format of the metadata a remote relationship was read from and must be written back as. We don't have a good way of doing metadata versioning yet, and we therefore use this to keep track of the format used.
RRFOldDBToRemoteSchema | The remote relationship was parsed from the old format, that was only used only for db-to-rs schemas. |
RRFUnifiedFormat | The remote relationship was parsed from the new unified format. |
data RemoteSourceRelationshipBuilder Source #
Specify whether remote schema <> source relationships should be built
data RemoteRelationshipDefinition Source #
Metadata representation of the internal definition of a remote relationship.
RelationshipToSource ToSourceRelationshipDef | Remote relationship targetting a source. |
RelationshipToSchema RRFormat ToSchemaRelationshipDef | Remote relationship targetting a remote schema. |
Instances
data RRParseMode Source #
Whether to accept legacy fields when parsing RemoteRelationshipDefinition
RRPLegacy | Only allow legacy fields when parsing |
RRPLenient | Allow legacy fields when parsing |
RRPStrict | Reject legacy fields when parsing |
Instances
Generic RRParseMode Source # | |
Defined in Hasura.RQL.Types.Relationships.Remote type Rep RRParseMode :: Type -> Type # from :: RRParseMode -> Rep RRParseMode x # to :: Rep RRParseMode x -> RRParseMode # | |
Show RRParseMode Source # | |
Defined in Hasura.RQL.Types.Relationships.Remote showsPrec :: Int -> RRParseMode -> ShowS # show :: RRParseMode -> String # showList :: [RRParseMode] -> ShowS # | |
Eq RRParseMode Source # | |
Defined in Hasura.RQL.Types.Relationships.Remote (==) :: RRParseMode -> RRParseMode -> Bool # (/=) :: RRParseMode -> RRParseMode -> Bool # | |
type Rep RRParseMode Source # | |
Defined in Hasura.RQL.Types.Relationships.Remote type Rep RRParseMode = D1 ('MetaData "RRParseMode" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RRPLegacy" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RRPLenient" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RRPStrict" 'PrefixI 'False) (U1 :: Type -> Type))) |
parseRemoteRelationshipDefinition :: RRParseMode -> Value -> Parser RemoteRelationshipDefinition Source #
Parse RemoteRelationshipDefinition
letting the caller decide how lenient to be.
This is necessary because RemoteRelationshipDefinition
is parsed in
different contexts. In RemoteRelationship
, the
RemoteRelationshipDefinition
is always parsed out from a top-level
@"definition" field. Thus, a legacy payload looks like this:
{ "name": "thing", "definition": { "remote_schema": "stuff", "hasura_fields": ... "remote_field": ... } }
and a new payload looks like this:
{ "name": "thing", "definition": { "to_remote_schema": { "schema": "stuff", "lhs_fields": ... "remote_field": ... } } }
In contrast, CreateFromSourceRelationship
does not have a top-
level "definition"
in its legacy format. Instead, the legacy fields
themselves are top-level:
{ "remote_schema": "stuff", "hasura_fields": ... "remote_field": ... }
Furthermore, the presence of a "definition"
field is used to detect
that the new payload is being used:
{ "definition": { "to_remote_schema": { "schema": "stuff", "lhs_fields": ... "remote_field": ... } } }
In this latter case, we should not allow "remote_schema"
to appear
under "definition"
.
data RemoteFieldInfo lhsJoinField Source #
Resolved remote relationship, as stored in the schema cache.
RemoteFieldInfo | |
|
Instances
data RemoteFieldInfoRHS Source #
Resolved remote relationship's RHS
Instances
data DBJoinField (b :: BackendType) Source #
Information about the field on the LHS of a join against a remote schema.
JoinColumn (Column b) (ColumnType b) | |
JoinComputedField (ScalarComputedField b) |
Instances
data ScalarComputedField (b :: BackendType) Source #
Information about a computed field appearing on the LHS of a remote join. FIXME: why do we need all of this?
Instances
tableNameToLHSIdentifier :: Backend b => TableName b -> LHSIdentifier Source #