graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
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.

data CreateRemoteSchemaRemoteRelationship Source #

Instances

Instances details
FromJSON CreateRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

ToJSON CreateRemoteSchemaRemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.DDL.RemoteRelationship

Generic 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 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

-> PartiallyResolvedRemoteSchemaMap

Required context to process cross boundary relationships

-> m (RemoteFieldInfo lhsJoinField, Seq 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?