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

Hasura.RQL.DDL.Relationship.Suggest

Description

This module provides an API for suggesting relationships so that the console (or client) does not need to construct and submit relationship queries itself.

This suggests reciprocal object relationships A -> object -> B -> object -> A if there is a unique constraint on the column(s) in A mapping A->B, and if not then a reciprocal array relationship A -> object -> B -> array -> A is suggested.

All JSON fields to the main exported function runSuggestRels are optional and behave as follows:

  • _srsSource: The source to suggest relationships for - Defaults to defaultSource
  • _srsTables: The tables to suggest relationships between - Defaults to all tables
  • _srsOmitTracked: Only suggest untracked relationships - Defaults to False

Autodocodec Codecs instances are implemented for these datatypes.

Synopsis

Documentation

data SuggestRels b Source #

Datatype used by Metadata API to represent Request for Suggested Relationships

Instances

Instances details
Backend b => FromJSON (SuggestRels b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Relationship.Suggest

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

Defined in Hasura.RQL.DDL.Relationship.Suggest

Backend b => HasCodec (SuggestRels b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Relationship.Suggest

Generic (SuggestRels b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Relationship.Suggest

Associated Types

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

Methods

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

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

Backend b => ToSchema (SuggestRels b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Relationship.Suggest

type Rep (SuggestRels b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Relationship.Suggest

type Rep (SuggestRels b) = D1 ('MetaData "SuggestRels" "Hasura.RQL.DDL.Relationship.Suggest" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "SuggestRels" 'PrefixI 'True) (S1 ('MetaSel ('Just "_srsSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourceName) :*: (S1 ('MetaSel ('Just "_srsTables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [TableName b])) :*: S1 ('MetaSel ('Just "_srsOmitTracked") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))))

runSuggestRels :: forall b m. (MonadError QErr m, CacheRWM m, BackendMetadata b) => SuggestRels b -> m EncJSON Source #

The method invoked when dispatching on metadata calls in POST v1metadata