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

Hasura.RQL.DDL.RemoteRelationship

Synopsis

Documentation

data CreateFromSourceRelationship (b :: BackendType) Source #

Argument to the _create_remote_relationship and _update_remote_relationship families of metadata commands.

For historical reason, this type is also used to represent a db-to-rs schema in the metadata.

data DeleteFromSourceRelationship (b :: BackendType) Source #

Argument to the _drop_remote_relationship family of metadata commands.

Instances

Instances details
Backend b => FromJSON (DeleteFromSourceRelationship b) Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

Methods

parseJSON :: Value -> Parser (DeleteFromSourceRelationship b)

parseJSONList :: Value -> Parser [DeleteFromSourceRelationship b]

data CreateRemoteSchemaRemoteRelationship Source #

Instances

Instances details
Generic CreateRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

FromJSON CreateRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

ToJSON CreateRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

type Rep CreateRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

type Rep CreateRemoteSchemaRemoteRelationship = D1 ('MetaData "CreateRemoteSchemaRemoteRelationship" "Hasura.RQL.DDL.RemoteRelationship" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "CreateRemoteSchemaRemoteRelationship" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_crsrrRemoteSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RemoteSchemaName) :*: S1 ('MetaSel ('Just "_crsrrType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Name)) :*: (S1 ('MetaSel ('Just "_crsrrName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RelName) :*: S1 ('MetaSel ('Just "_crsrrDefinition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RemoteRelationshipDefinition))))

data DeleteRemoteSchemaRemoteRelationship Source #

Argument to the _drop_remote_relationship family of metadata commands.

Instances

Instances details
FromJSON DeleteRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

data PartiallyResolvedSource b Source #

Internal intermediary step.

We build the output of sources in two steps: 1. we first resolve sources, and collect the core info of their tables 2. we then build the entire output from the collection of partially resolved sources

We need this split to be able to resolve cross-source relationships: to process one source's remote relationship, we need to know about the target source's tables core info.

This data structure is used as an argument to AnyBackend in the backend-agnostic intermediary collection, and used here to build remote field info.

buildRemoteFieldInfo Source #

Arguments

:: QErrM m 
=> LHSIdentifier

The entity on which the remote relationship is defined

-> HashMap FieldName lhsJoinField

join fields provided by the LHS entity

-> RemoteRelationship

definition of remote relationship

-> HashMap SourceName (AnyBackend PartiallyResolvedSource)

Required context to process cross boundary relationships

-> RemoteSchemaMap

Required context to process cross boundary relationships

-> m (RemoteFieldInfo lhsJoinField, [SchemaDependency])

returns 1. schema cache representation of the remote relationships 2. the dependencies on the RHS of the join. The dependencies on the LHS entities has to be handled by the calling function

Builds the schema cache representation of a remote relationship TODO: this is not actually called by the remote relationship DDL API and is only used as part of the schema cache process. Should this be moved elsewhere?