Skip to content

Commit e654df1

Browse files
committed
chore: remove urql stuff from main Query module
1 parent da0099c commit e654df1

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

src/GraphQL/Client/Query.purs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2220
import Prelude
2321

24-
import Affjax (URL)
2522
import Control.Monad.Error.Class (class MonadThrow)
2623
import Control.Monad.Except (class MonadError, catchError)
2724
import Data.Argonaut.Core (Json, stringify)
@@ -32,9 +29,7 @@ import Data.Either (Either(..), hush)
3229
import Data.Maybe (Maybe(..))
3330
import Data.Traversable (traverse)
3431
import Effect.Aff (Aff, Error, error, message, throwError)
35-
import Effect.Class (liftEffect)
3632
import Foreign.Object (Object)
37-
import GraphQL.Client.BaseClients.Urql (UrqlClient, createGlobalClientUnsafe)
3833
import GraphQL.Client.GqlError (GqlError)
3934
import GraphQL.Client.Operation (OpMutation, OpQuery)
4035
import GraphQL.Client.SafeQueryName (safeQueryName)
@@ -97,26 +92,6 @@ query
9792
-> Aff returns
9893
query = 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-
12095
mutationWithDecoder
12196
:: forall client directives schema mutation returns queryOpts mutationOpts sr
12297
. QueryClient client queryOpts mutationOpts
@@ -167,24 +142,6 @@ mutationOpts
167142
-> Aff returns
168143
mutationOpts = 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-
188145
runQuery
189146
:: forall client directives schema query returns qOpts mOpts
190147
. QueryClient client qOpts mOpts

0 commit comments

Comments
 (0)