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

Hasura.Server.API.Backend

Description

BackendAPI

This module defines the BackendAPI class, alongside a few helpers. Its goal is to delegate to backends the responsibility of creating the parsers for the metadata API. Each backend is expected to provide a list of CommandParser, which in turn is a simple function from command name and command arguments to a corresponding parser. Command parsers can easily be created using the commandParser function.

Furthermore, for each set of related features, such as table tracking commands, or permission commands, a helper function is provided, that allows a backend to write its instance by simply listing the set of features it supports.

Documentation

type CommandParser b = BackendSourceKind b -> Text -> Value -> Parser (Maybe RQLMetadataV1) Source #

commandParserWithExplicitParser Source #

Arguments

:: (BackendSourceKind b -> Value -> Parser a)

Explicit parsing function that also takes a BackendKind

-> Text

expected command name

-> (a -> RQLMetadataV1)

corresponding parser

-> CommandParser b 

commandParser Source #

Arguments

:: FromJSON a 
=> Text

expected command name

-> (a -> RQLMetadataV1)

corresponding parser

-> CommandParser b 

commandParserWithBackendKind Source #

Arguments

:: FromJSONWithContext (BackendSourceKind b) a 
=> Text

expected command name

-> (a -> RQLMetadataV1)

corresponding parser

-> CommandParser b