graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.RQL.Types.Relationships.Remote

Synopsis

Documentation

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

Show RRFormat Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Eq 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 RemoteSourceRelationshipBuilder Source #

Specify whether remote schema <> source relationships should be built

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
FromJSON RemoteRelationship Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

(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

HasCodec RemoteRelationship 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 #

Show RemoteRelationshipDefinition Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Eq 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
Generic RRParseMode Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Associated Types

type Rep RRParseMode :: Type -> Type #

Show RRParseMode Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Eq RRParseMode Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

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
ToJSON lhsJoinField => ToJSON (RemoteFieldInfo lhsJoinField) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

Methods

toJSON :: RemoteFieldInfo lhsJoinField -> Value Source #

toEncoding :: RemoteFieldInfo lhsJoinField -> Encoding Source #

toJSONList :: [RemoteFieldInfo lhsJoinField] -> Value Source #

toEncodingList :: [RemoteFieldInfo lhsJoinField] -> Encoding Source #

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 #

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 #

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

data DBJoinField (b :: BackendType) Source #

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

Instances

Instances details
Backend b => ToJSON (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 => Show (DBJoinField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

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

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => Hashable (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 => ToJSON (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 => Show (ScalarComputedField b) Source # 
Instance details

Defined in Hasura.RQL.Types.Relationships.Remote

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

Defined in Hasura.RQL.Types.Relationships.Remote

Backend b => Hashable (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))))))