Module

GraphQL.Client.Query

#query

query :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => DecodeJson returns => (Client client schema a b) -> String -> query -> Aff returns

Run a graphQL query

#queryWithDecoder

queryWithDecoder :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => (Json -> Either JsonDecodeError returns) -> (Client client schema a b) -> String -> query -> Aff returns

Run a graphQL query with a custom decoder

#queryOptsWithDecoder

queryOptsWithDecoder :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => (Json -> Either JsonDecodeError returns) -> (queryOpts -> queryOpts) -> (Client client schema a b) -> String -> query -> Aff returns

Run a graphQL query with a custom decoder and custom options

#queryOpts

queryOpts :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => DecodeJson returns => (queryOpts -> queryOpts) -> (Client client schema a b) -> String -> query -> Aff returns

Run a graphQL query with custom options

#query_

query_ :: forall schema query returns. GqlQuery schema query returns => DecodeJson returns => URL -> Proxy schema -> String -> query -> Aff returns

A create client and query shortcut that creates a global client and caches it for future calls. query is a safer option for production environments and should generally be used

#mutation

mutation :: forall client schema mutation returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema mutation returns => DecodeJson returns => (Client client a schema b) -> String -> mutation -> Aff returns

#mutationWithDecoder

mutationWithDecoder :: forall client schema mutation returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema mutation returns => (Json -> Either JsonDecodeError returns) -> (Client client a schema b) -> String -> mutation -> Aff returns

#mutationOptsWithDecoder

mutationOptsWithDecoder :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => (Json -> Either JsonDecodeError returns) -> (mutationOpts -> mutationOpts) -> (Client client a schema b) -> String -> query -> Aff returns

Run a graphQL query with a custom decoder and custom options

#mutationOpts

mutationOpts :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => DecodeJson returns => (mutationOpts -> mutationOpts) -> (Client client a schema b) -> String -> query -> Aff returns

Run a graphQL query with a custom decoder and custom options

#mutation_

mutation_ :: forall schema mutation returns. GqlQuery schema mutation returns => DecodeJson returns => URL -> Proxy schema -> String -> mutation -> Aff returns

#decodeGqlRes

#queryFullRes

queryFullRes :: forall client schema query returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema query returns => DecodeJson returns => (Json -> Either JsonDecodeError returns) -> (queryOpts -> queryOpts) -> (Client client schema a b) -> String -> query -> Aff (GqlRes returns)

Run a graphQL query, getting the full response, According to https://spec.graphql.org/June2018/#sec-Response-Format

#mutationFullRes

mutationFullRes :: forall client schema mutation returns a b queryOpts mutationOpts. QueryClient client queryOpts mutationOpts => GqlQuery schema mutation returns => DecodeJson returns => (Json -> Either JsonDecodeError returns) -> (mutationOpts -> mutationOpts) -> (Client client a schema b) -> String -> mutation -> Aff (GqlRes returns)

Run a graphQL mutation, getting the full response, According to https://spec.graphql.org/June2018/#sec-Response-Format

#getFullRes

getFullRes :: forall res. (Json -> Either JsonDecodeError res) -> Json -> GqlRes res

#addErrorInfo

addErrorInfo :: forall m a q. MonadError Error m => GqlQueryString q => String -> q -> m a -> m a

Modules