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

Hasura.GraphQL.Transport.HTTP.Protocol

Synopsis

Documentation

newtype GQLExecDoc Source #

Instances

Instances details
FromJSON GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

ToJSON GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Eq GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Ord GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Hashable GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Lift GQLExecDoc Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

lift :: Quote m => GQLExecDoc -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => GQLExecDoc -> Code m GQLExecDoc #

newtype OperationName Source #

Constructors

OperationName 

Instances

Instances details
FromJSON OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

ToJSON OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Eq OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Ord OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Hashable OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Lift OperationName Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

lift :: Quote m => OperationName -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => OperationName -> Code m OperationName #

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 :: Quote m => GQLReq a -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => GQLReq a -> Code m (GQLReq a) #

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

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

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

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

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 #

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 #

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 #

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

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Methods

hashWithSalt :: Int -> GQLReq a -> Int Source #

hash :: GQLReq a -> Int Source #

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 #

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

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

ToJSON a => ToJSON (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 #

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

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

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

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

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 

Instances

Instances details
FromJSON GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

ToJSON GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

IsString GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Show GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Eq GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Ord GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

Hashable GQLQueryText Source # 
Instance details

Defined in Hasura.GraphQL.Transport.HTTP.Protocol

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/

getOpNameFromParsedReq :: GQLReqParsed -> Maybe OperationName Source #

Get operation name from parsed executable document if the field operationName is not explicitly sent by the client in the body of the request