@@ -9,19 +9,16 @@ module GraphQL.Client.Query
99 , mutationOpts
1010 , mutationOptsWithDecoder
1111 , mutationWithDecoder
12- , mutation_
1312 , query
1413 , queryFullRes
1514 , queryJson
1615 , queryOpts
1716 , queryOptsWithDecoder
1817 , queryWithDecoder
19- , query_
2018 ) where
2119
2220import Prelude
2321
24- import Affjax (URL )
2522import Control.Monad.Error.Class (class MonadThrow )
2623import Control.Monad.Except (class MonadError , catchError )
2724import Data.Argonaut.Core (Json , stringify )
@@ -32,9 +29,7 @@ import Data.Either (Either(..), hush)
3229import Data.Maybe (Maybe (..))
3330import Data.Traversable (traverse )
3431import Effect.Aff (Aff , Error , error , message , throwError )
35- import Effect.Class (liftEffect )
3632import Foreign.Object (Object )
37- import GraphQL.Client.BaseClients.Urql (UrqlClient , createGlobalClientUnsafe )
3833import GraphQL.Client.GqlError (GqlError )
3934import GraphQL.Client.Operation (OpMutation , OpQuery )
4035import GraphQL.Client.SafeQueryName (safeQueryName )
9792 -> Aff returns
9893query = queryWithDecoder decodeJson
9994
100- -- | A create client and query shortcut that creates a global client and caches it for future calls.
101- -- | `query` is a safer option for production environments and should generally be used
102- query_
103- :: forall directives schema query returns
104- . GqlQuery directives OpQuery schema query returns
105- => DecodeJson returns
106- => URL
107- -> Proxy schema
108- -> String
109- -> query
110- -> Aff returns
111- query_ url _ name q = do
112- client <-
113- liftEffect
114- $ createGlobalClientUnsafe
115- { url
116- , headers: []
117- }
118- query (client :: Client UrqlClient { directives :: Proxy directives , query :: schema | _ } ) name q
119-
12095mutationWithDecoder
12196 :: forall client directives schema mutation returns queryOpts mutationOpts sr
12297 . QueryClient client queryOpts mutationOpts
@@ -167,24 +142,6 @@ mutationOpts
167142 -> Aff returns
168143mutationOpts = mutationOptsWithDecoder decodeJson
169144
170- mutation_
171- :: forall directives schema mutation returns
172- . GqlQuery directives OpMutation schema mutation returns
173- => DecodeJson returns
174- => URL
175- -> Proxy schema
176- -> String
177- -> mutation
178- -> Aff returns
179- mutation_ url _ name q = do
180- client <-
181- liftEffect
182- $ createGlobalClientUnsafe
183- { url
184- , headers: []
185- }
186- mutation (client :: Client UrqlClient { directives :: Proxy directives , mutation :: schema | _ } ) name q
187-
188145runQuery
189146 :: forall client directives schema query returns qOpts mOpts
190147 . QueryClient client qOpts mOpts
0 commit comments