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

Hasura.GraphQL.Schema.Common

Synopsis

Documentation

data SchemaContext Source #

Aggregation of contextual information required to build the schema.

Constructors

SchemaContext 

Fields

data SchemaKind Source #

The kind of schema we're building, and its associated options.

type MonadBuildSchemaBase r m n = (MonadError QErr m, MonadReader r m, MonadMemoize m, MonadParse n, Has SchemaOptions r, Has SchemaContext r, Has MkTypename r, Has CustomizeRemoteFieldName r, Has NamingCase r) Source #

The set of common constraints required to build the schema.

newtype RemoteRelationshipParserBuilder Source #

How a remote relationship field should be processed when building a schema. Injecting this function from the top level avoids having to know how to do top-level dispatch from deep within the schema code.

Note: the inner function type uses an existential qualifier: it is expected that the given function will work for _any_ monad m that has the relevant constraints. This prevents us from passing a function that is specfic to the monad in which the schema construction will run, but avoids having to propagate type annotations to each call site.

Constructors

RemoteRelationshipParserBuilder (forall lhsJoinField r n m. MonadBuildSchemaBase r m n => RemoteFieldInfo lhsJoinField -> m (Maybe [FieldParser n (RemoteRelationshipField UnpreparedValue)])) 

ignoreRemoteRelationship :: RemoteRelationshipParserBuilder Source #

A RemoteRelationshipParserBuilder that ignores the field altogether, that can be used in tests or to build a source or remote schema in isolation.

newtype NodeInterfaceParserBuilder Source #

How to build the Relay node.

Similarly to what we do for remote relationships, we pass in the context the builder function required to build the Node interface, in order to avoid the cross-sources cycles it creates otherwise.

Constructors

NodeInterfaceParserBuilder 

Fields

retrieve :: (MonadReader r m, Has a r) => (a -> b) -> m b Source #

askTableInfo :: forall b m. (Backend b, MonadError QErr m) => SourceInfo b -> TableName b -> m (TableInfo b) Source #

Looks up table information for the given table name. This function should never fail, since the schema cache construction process is supposed to ensure all dependencies are resolved. TODO: deduplicate this with CacheRM.

data Scenario Source #

Whether the request is sent with `x-hasura-use-backend-only-permissions` set to true.

Constructors

Backend 
Frontend 

textToName :: MonadError QErr m => Text -> m Name Source #

parsedSelectionsToFields Source #

Arguments

:: (Text -> a)

how to handle __typename fields

-> InsOrdHashMap Name (ParsedSelection a) 
-> Fields a 

mkDescriptionWith :: Maybe PGDescription -> Text -> Description Source #

requiredFieldParser :: (Functor n, Functor m) => (a -> b) -> m (FieldParser n a) -> m (Maybe (FieldParser n b)) Source #

optionalFieldParser :: (Functor n, Functor m) => (a -> b) -> m (Maybe (FieldParser n a)) -> m (Maybe (FieldParser n b)) Source #

mkEnumTypeName :: forall b m r. (Backend b, MonadReader r m, Has MkTypename r, MonadError QErr m, Has NamingCase r) => EnumReference b -> m Name Source #

Builds the type name for referenced enum tables.