Module

GraphQL.Client.Query

Package
purescript-graphql-client
Repository
OxfordAbstracts/purescript-graphql-client

#query Source

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 Source

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 Source

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 Source

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_ Source

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 Source

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 Source

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 Source

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 Source

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_ Source

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

#decodeGqlRes Source

#queryFullRes Source

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 Source

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 Source

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

#addErrorInfo Source

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