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

Hasura.GraphQL.Transport.HTTP.Protocol

Synopsis

Documentation

newtype GQLExecDoc Source #

Constructors

GQLExecDoc 

Fields

Instances

Instances details
Eq GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Ord GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Hashable GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

FromJSON GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

parseJSON :: Value -> Parser GQLExecDoc

parseJSONList :: Value -> Parser [GQLExecDoc]

ToJSON GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

toJSON :: GQLExecDoc -> Value

toEncoding :: GQLExecDoc -> Encoding

toJSONList :: [GQLExecDoc] -> Value

toEncodingList :: [GQLExecDoc] -> Encoding

Lift GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

newtype OperationName Source #

Constructors

OperationName 

Fields

Instances

Instances details
Eq OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Ord OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Hashable OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

FromJSON OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

parseJSON :: Value -> Parser OperationName

parseJSONList :: Value -> Parser [OperationName]

ToJSON OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

toJSON :: OperationName -> Value

toEncoding :: OperationName -> Encoding

toJSONList :: [OperationName] -> Value

toEncodingList :: [OperationName] -> Encoding

Lift OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

type VariableValues = HashMap Name Value Source #

data GQLReq a Source #

Instances

Instances details
Functor GQLReq Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

fmap :: (a -> b) -> GQLReq a -> GQLReq b #

(<$) :: a -> GQLReq b -> GQLReq a #

Lift a => Lift (GQLReq a :: Type) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

lift :: GQLReq a -> Q Exp #

liftTyped :: GQLReq a -> Q (TExp (GQLReq a)) #

Eq a => Eq (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

(==) :: GQLReq a -> GQLReq a -> Bool #

(/=) :: GQLReq a -> GQLReq a -> Bool #

Show a => Show (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

showsPrec :: Int -> GQLReq a -> ShowS #

show :: GQLReq a -> String #

showList :: [GQLReq a] -> ShowS #

Generic (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Associated Types

type Rep (GQLReq a) :: Type -> Type #

Methods

from :: GQLReq a -> Rep (GQLReq a) x #

to :: Rep (GQLReq a) x -> GQLReq a #

Hashable a => Hashable (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

hashWithSalt :: Int -> GQLReq a -> Int

hash :: GQLReq a -> Int

FromJSON a => FromJSON (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

parseJSON :: Value -> Parser (GQLReq a)

parseJSONList :: Value -> Parser [GQLReq a]

ToJSON a => ToJSON (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

toJSON :: GQLReq a -> Value

toEncoding :: GQLReq a -> Encoding

toJSONList :: [GQLReq a] -> Value

toEncodingList :: [GQLReq a] -> Encoding

type Rep (GQLReq a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

type Rep (GQLReq a) = D1 ('MetaData "GQLReq" "Hasura.GraphQL.Transport.HTTP.Protocol" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "GQLReq" 'PrefixI 'True) (S1 ('MetaSel ('Just "_grOperationName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe OperationName)) :*: (S1 ('MetaSel ('Just "_grQuery") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "_grVariables") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe VariableValues)))))

data GQLBatchedReqs a Source #

Batched queries are sent as a JSON array of GQLReq records. This newtype exists to support the unusual JSON encoding.

See https://github.com/hasura/graphql-engine/issues/1812.

Constructors

GQLSingleRequest a 
GQLBatchedReqs [a] 

Instances

Instances details
Functor GQLBatchedReqs Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

fmap :: (a -> b) -> GQLBatchedReqs a -> GQLBatchedReqs b #

(<$) :: a -> GQLBatchedReqs b -> GQLBatchedReqs a #

Eq a => Eq (GQLBatchedReqs a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show a => Show (GQLBatchedReqs a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Generic (GQLBatchedReqs a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Associated Types

type Rep (GQLBatchedReqs a) :: Type -> Type #

FromJSON a => FromJSON (GQLBatchedReqs a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

parseJSON :: Value -> Parser (GQLBatchedReqs a)

parseJSONList :: Value -> Parser [GQLBatchedReqs a]

ToJSON a => ToJSON (GQLBatchedReqs a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

toJSON :: GQLBatchedReqs a -> Value

toEncoding :: GQLBatchedReqs a -> Encoding

toJSONList :: [GQLBatchedReqs a] -> Value

toEncodingList :: [GQLBatchedReqs a] -> Encoding

type Rep (GQLBatchedReqs a) Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

type Rep (GQLBatchedReqs a) = D1 ('MetaData "GQLBatchedReqs" "Hasura.GraphQL.Transport.HTTP.Protocol" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "GQLSingleRequest" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)) :+: C1 ('MetaCons "GQLBatchedReqs" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [a])))

newtype GQLQueryText Source #

Constructors

GQLQueryText 

Fields

Instances

Instances details
Eq GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Ord GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

IsString GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Hashable GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

FromJSON GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

parseJSON :: Value -> Parser GQLQueryText

parseJSONList :: Value -> Parser [GQLQueryText]

ToJSON GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

toJSON :: GQLQueryText -> Value

toEncoding :: GQLQueryText -> Encoding

toJSONList :: [GQLQueryText] -> Value

toEncodingList :: [GQLQueryText] -> Encoding

type GQLReqUnparsed = GQLReq GQLQueryText Source #

We've not yet parsed the graphql query string parameter of the POST.

type GQLReqParsed = GQLReq GQLExecDoc Source #

Invariants:

  • when _grOperationName is Nothing, _grQuery contains exactly one ExecutableDefinitionOperation (and zero or more ExecutableDefinitionFragment)
  • when _grOperationName is present, there is a corresponding ExecutableDefinitionOperation in _grQuery

type GQLReqOutgoing = GQLReq SingleOperation Source #

A simplified form of GQLReqParsed which is more ergonomic in particular for APIs that act as graphql clients (e.g. in remote relationship execution). This is a "desugared" request in which fragments have been inlined (see inlineSelectionSet), and the operation (_grOperationName) to be executed is the only payload (in contrast to a ExecutableDocument with possibly many named operations).

_grOperationName is essentially ignored here, but should correspond with _todName if present.

These could maybe benefit from an HKD refactoring.

type SingleOperation = TypedOperationDefinition NoFragments Name Source #

A single graphql operation to be executed, with fragment definitions inlined. This is the simplified form of GQLExecDoc or ExecutableDocument:

getSingleOperation :: MonadError QErr m => GQLReqParsed -> m SingleOperation Source #

Obtain the actual single operation to be executed, from the possibly- multi-operation document, validating per the spec and inlining any fragment definitions (pre-defined parts of a graphql query) at fragment spreads (locations where fragments are "spliced"). See:

https://spec.graphql.org/June2018/#sec-Executable-Definitions and... https://graphql.org/learn/serving-over-http/

encodeGQErr :: Bool -> QErr -> Value Source #

newtype GQExecError Source #

Constructors

GQExecError [Value] 

Instances

Instances details
Eq GQExecError Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show GQExecError Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

ToJSON GQExecError Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

toJSON :: GQExecError -> Value

toEncoding :: GQExecError -> Encoding

toJSONList :: [GQExecError] -> Value

toEncodingList :: [GQExecError] -> Encoding