Module

GraphQL.Client.Types

#GqlQuery

class (QueryReturns schema query returns, GqlQueryString query) <= GqlQuery schema query returns | schema query -> returns

Instances

#Client

newtype Client baseClient querySchema mutationSchema subscriptionSchema

Constructors

#QueryClient

class QueryClient baseClient queryOpts mutationOpts | baseClient -> queryOpts mutationOpts where

A type class for making a graphql request client. Apollo, urql and xhr2/Affjax baseClients are provided. If you wish to use a different base client, you can create your own client, make it an instance of QueryClient and pass it to query

Members

#SubscriptionClient

class SubscriptionClient baseClient opts | baseClient -> opts where

A type class for making graphql subscriptions. If you wish to use a different underlying client, you can create your own client, make it an instance of SubscriptionClient and pass it to subscription

Members

#subscriptionEventOpts

subscriptionEventOpts :: forall opts c. SubscriptionClient c opts => (opts -> opts) -> c -> String -> Emitter Json

#subscriptionEvent

subscriptionEvent :: forall opts c. SubscriptionClient c opts => c -> String -> Emitter Json

#WatchQueryClient

class WatchQueryClient baseClient opts | baseClient -> opts where

A type class for making graphql watch queries (observable queries). If you wish to use a different underlying client, you can create your own client, make it an instance of WatchQueryClient and pass it to watchQuery

Members

#watchQueryEventOpts

watchQueryEventOpts :: forall opts c. WatchQueryClient c opts => (opts -> opts) -> c -> String -> Emitter Json

#watchQueryEvent

watchQueryEvent :: forall opts c. WatchQueryClient c opts => c -> String -> Emitter Json

#GqlRes

type GqlRes res = { data_ :: Either JsonDecodeError res, errors :: Maybe (Array GqlError), errors_json :: Maybe (Array Json), extensions :: Maybe (Object Json) }

The full graphql query response, According to https://spec.graphql.org/June2018/#sec-Response-Format

#GqlError

type GqlError = { extensions :: Maybe (Object Json), locations :: ErrorLocations, message :: String, path :: Maybe (Array (Either Int String)) }

#ErrorLocations

type ErrorLocations = Maybe (Array { column :: Int, line :: Int })

Modules