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

Hasura.RQL.Types.Relationships.Remote

Synopsis

Documentation

data RemoteRelationship Source #

Metadata representation of a generic remote relationship, regardless of the source: all sources use this same agnostic definition. The internal definition field is where we differentiate between different targets.

Instances

Instances details
Eq RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Show RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep RemoteRelationship :: Type -> Type #

FromJSON RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Methods

parseJSON :: Value -> Parser RemoteRelationship

parseJSONList :: Value -> Parser [RemoteRelationship]

ToJSON RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Cacheable RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RemoteRelationship = D1 ('MetaData "RemoteRelationship" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RemoteRelationship" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rrName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RelName) :*: S1 ('MetaSel ('Just "_rrDefinition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RemoteRelationshipDefinition)))

data RRFormat Source #

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.

Constructors

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.

Instances

Instances details
Eq RRFormat Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Show RRFormat Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic RRFormat Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep RRFormat :: Type -> Type #

Methods

from :: RRFormat -> Rep RRFormat x #

to :: Rep RRFormat x -> RRFormat #

Cacheable RRFormat Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RRFormat Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RRFormat = D1 ('MetaData "RRFormat" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RRFOldDBToRemoteSchema" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RRFUnifiedFormat" 'PrefixI 'False) (U1 :: Type -> Type))

data RemoteRelationshipDefinition Source #

Metadata representation of the internal definition of a remote relationship.

Constructors

RelationshipToSource ToSourceRelationshipDef

Remote relationship targetting a source.

RelationshipToSchema RRFormat ToSchemaRelationshipDef

Remote relationship targetting a remote schema.

Instances

Instances details
Eq RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Show RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep RemoteRelationshipDefinition :: Type -> Type #

(TypeError (('ShowType RemoteRelationshipDefinition :<>: 'Text " has different JSON representations depending on context;") :$$: 'Text "call \8216parseRemoteRelationshipDefinition\8217 directly instead of relying on \8216FromJSON\8217") :: Constraint) => FromJSON RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

ToJSON RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Cacheable RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

data RRParseMode Source #

Whether to accept legacy fields when parsing RemoteRelationshipDefinition

Constructors

RRPLegacy

Only allow legacy fields when parsing RemoteRelationshipDefinition

RRPLenient

Allow legacy fields when parsing RemoteRelationshipDefinition

RRPStrict

Reject legacy fields when parsing RemoteRelationshipDefinition

Instances

Instances details
Eq RRParseMode Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Show RRParseMode Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic RRParseMode Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep RRParseMode :: Type -> Type #

type Rep RRParseMode Source # 
Instance details

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.

Constructors

RemoteFieldInfo 

Fields

Instances

Instances details
Eq lhsJoinField => Eq (RemoteFieldInfo lhsJoinField) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Methods

(==) :: RemoteFieldInfo lhsJoinField -> RemoteFieldInfo lhsJoinField -> Bool #

(/=) :: RemoteFieldInfo lhsJoinField -> RemoteFieldInfo lhsJoinField -> Bool #

Generic (RemoteFieldInfo lhsJoinField) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep (RemoteFieldInfo lhsJoinField) :: Type -> Type #

Methods

from :: RemoteFieldInfo lhsJoinField -> Rep (RemoteFieldInfo lhsJoinField) x #

to :: Rep (RemoteFieldInfo lhsJoinField) x -> RemoteFieldInfo lhsJoinField #

ToJSON lhsJoinField => ToJSON (RemoteFieldInfo lhsJoinField) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Methods

toJSON :: RemoteFieldInfo lhsJoinField -> Value

toEncoding :: RemoteFieldInfo lhsJoinField -> Encoding

toJSONList :: [RemoteFieldInfo lhsJoinField] -> Value

toEncodingList :: [RemoteFieldInfo lhsJoinField] -> Encoding

Cacheable lhsJoinField => Cacheable (RemoteFieldInfo lhsJoinField) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Methods

unchanged :: Accesses -> RemoteFieldInfo lhsJoinField -> RemoteFieldInfo lhsJoinField -> Bool Source #

type Rep (RemoteFieldInfo lhsJoinField) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep (RemoteFieldInfo lhsJoinField) = D1 ('MetaData "RemoteFieldInfo" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RemoteFieldInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rfiLHS") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HashMap FieldName lhsJoinField)) :*: S1 ('MetaSel ('Just "_rfiRHS") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RemoteFieldInfoRHS)))

data RemoteFieldInfoRHS Source #

Resolved remote relationship's RHS

Instances

Instances details
Eq RemoteFieldInfoRHS Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic RemoteFieldInfoRHS Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep RemoteFieldInfoRHS :: Type -> Type #

ToJSON RemoteFieldInfoRHS Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Cacheable RemoteFieldInfoRHS Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RemoteFieldInfoRHS Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep RemoteFieldInfoRHS = D1 ('MetaData "RemoteFieldInfoRHS" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RFISchema" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RemoteSchemaFieldInfo)) :+: C1 ('MetaCons "RFISource" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (AnyBackend RemoteSourceFieldInfo))))

data DBJoinField (b :: BackendType) Source #

Information about the field on the LHS of a join against a remote schema.

Instances

Instances details
Backend b => Eq (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => Show (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep (DBJoinField b) :: Type -> Type #

Methods

from :: DBJoinField b -> Rep (DBJoinField b) x #

to :: Rep (DBJoinField b) x -> DBJoinField b #

Backend b => Hashable (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => ToJSON (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Methods

toJSON :: DBJoinField b -> Value

toEncoding :: DBJoinField b -> Encoding

toJSONList :: [DBJoinField b] -> Value

toEncodingList :: [DBJoinField b] -> Encoding

Backend b => Cacheable (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep (DBJoinField b) = D1 ('MetaData "DBJoinField" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "JoinColumn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Column b)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ColumnType b))) :+: C1 ('MetaCons "JoinComputedField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ScalarComputedField b))))

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

Instances details
Backend b => Eq (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => Show (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Generic (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep (ScalarComputedField b) :: Type -> Type #

Backend b => Hashable (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => ToJSON (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => Cacheable (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

type Rep (ScalarComputedField b) = D1 ('MetaData "ScalarComputedField" "Hasura.RQL.Types.Relationships.Remote" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ScalarComputedField" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_scfXField") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (XComputedField b)) :*: S1 ('MetaSel ('Just "_scfName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ComputedFieldName)) :*: (S1 ('MetaSel ('Just "_scfFunction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (FunctionName b)) :*: (S1 ('MetaSel ('Just "_scfComputedFieldImplicitArgs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ComputedFieldImplicitArguments b)) :*: S1 ('MetaSel ('Just "_scfType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ScalarType b))))))