graphql-engine/server/src-lib/Hasura/RQL/IR/RemoteJoin.hs
Antoine Leblanc 61c990f177
server: split RQL.DML into four different parts (#6072)
* WIP: shuffle everything around

* remove all unused imports & unused top-level binds

* move types to IR subfolder

* revert unrelated changes to Query and Prepare

* reduce differences in remote join, deprecate Translate module

* clean mutation module

* cosmetic: code formatting

* moved some RQL-specific stuff out of IR

* fix misc compilation issues

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-29 16:58:13 +00:00

28 lines
1.1 KiB
Haskell

module Hasura.RQL.IR.RemoteJoin
( RemoteJoin(..)
) where
import Hasura.Prelude
import qualified Language.GraphQL.Draft.Syntax as G
import Hasura.GraphQL.Parser hiding (field)
import Hasura.RQL.IR.Select
import Hasura.RQL.Types
-- | A 'RemoteJoin' represents the context of remote relationship to be extracted from 'AnnFieldG's.
data RemoteJoin (b :: Backend)
= RemoteJoin
{ _rjName :: !FieldName -- ^ The remote join field name.
, _rjArgs :: ![RemoteFieldArgument] -- ^ User-provided arguments with variables.
, _rjSelSet :: !(G.SelectionSet G.NoFragments Variable) -- ^ User-provided selection set of remote field.
, _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)