2020-10-29 19:58:13 +03:00
|
|
|
module Hasura.RQL.IR.RemoteJoin
|
|
|
|
( RemoteJoin(..)
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Hasura.Prelude
|
|
|
|
|
|
|
|
import qualified Language.GraphQL.Draft.Syntax as G
|
|
|
|
|
|
|
|
import Hasura.RQL.IR.Select
|
|
|
|
import Hasura.RQL.Types
|
|
|
|
|
|
|
|
|
|
|
|
-- | A 'RemoteJoin' represents the context of remote relationship to be extracted from 'AnnFieldG's.
|
2020-11-12 12:25:48 +03:00
|
|
|
data RemoteJoin (b :: BackendType)
|
2020-10-29 19:58:13 +03:00
|
|
|
= RemoteJoin
|
|
|
|
{ _rjName :: !FieldName -- ^ The remote join field name.
|
|
|
|
, _rjArgs :: ![RemoteFieldArgument] -- ^ User-provided arguments with variables.
|
2021-01-19 23:56:53 +03:00
|
|
|
, _rjSelSet :: !(G.SelectionSet G.NoFragments RemoteSchemaVariable) -- ^ User-provided selection set of remote field.
|
2020-10-29 19:58:13 +03:00
|
|
|
, _rjHasuraFields :: !(HashSet FieldName) -- ^ Table fields.
|
|
|
|
, _rjFieldCall :: !(NonEmpty FieldCall) -- ^ Remote server fields.
|
|
|
|
, _rjRemoteSchema :: !RemoteSchemaInfo -- ^ The remote schema server info.
|
|
|
|
, _rjPhantomFields :: ![ColumnInfo b]
|
|
|
|
-- ^ Hasura fields which are not in the selection set, but are required as
|
|
|
|
-- parameters to satisfy the remote join.
|
|
|
|
}
|
|
|
|
deriving instance Eq (RemoteJoin 'Postgres)
|