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
#decodeGqlRes Source
decodeGqlRes :: forall a. (Json -> Either JsonDecodeError a) -> Json -> Either JsonDecodeError a
#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
- Modules
- Data.
GraphQL. AST - Data.
GraphQL. Parser - GraphQL.
Client. Alias - GraphQL.
Client. Alias. Dynamic - GraphQL.
Client. Args - GraphQL.
Client. BaseClients. Affjax. Internal - GraphQL.
Client. BaseClients. Affjax. Node - GraphQL.
Client. BaseClients. Affjax. Web - GraphQL.
Client. BaseClients. Apollo - GraphQL.
Client. BaseClients. Apollo. ErrorPolicy - GraphQL.
Client. BaseClients. Apollo. FetchPolicy - GraphQL.
Client. BaseClients. Urql - GraphQL.
Client. CodeGen. GetSymbols - GraphQL.
Client. CodeGen. Js - GraphQL.
Client. CodeGen. Lines - GraphQL.
Client. CodeGen. Query - GraphQL.
Client. CodeGen. Schema - GraphQL.
Client. CodeGen. Template. Enum - GraphQL.
Client. CodeGen. Template. Schema - GraphQL.
Client. CodeGen. Transform. NullableOverrides - GraphQL.
Client. CodeGen. Types - GraphQL.
Client. ID - GraphQL.
Client. Query - GraphQL.
Client. QueryReturns - GraphQL.
Client. SafeQueryName - GraphQL.
Client. Subscription - GraphQL.
Client. ToGqlString - GraphQL.
Client. Types - GraphQL.
Client. Union - GraphQL.
Client. Variable - GraphQL.
Client. Variables - GraphQL.
Client. Variables. TypeName - GraphQL.
Client. WatchQuery - GraphQL.
Hasura. Array - GraphQL.
Hasura. ComparisonExp - GraphQL.
Hasura. Decode - GraphQL.
Hasura. DecodeLiberal - GraphQL.
Hasura. Encode