mirror of
https://github.com/rowtype-yoga/purescript-graphql-fundeps.git
synced 2024-11-25 07:07:45 +03:00
Updates naming conventions
This commit is contained in:
parent
018f8c702b
commit
de088099ad
@ -17,13 +17,16 @@ to generate this file without the comments in this block.
|
||||
, "console"
|
||||
, "effect"
|
||||
, "either"
|
||||
, "foreign"
|
||||
, "http-methods"
|
||||
, "lists"
|
||||
, "maybe"
|
||||
, "media-types"
|
||||
, "prelude"
|
||||
, "psci-support"
|
||||
, "simple-json"
|
||||
, "strings"
|
||||
, "transformers"
|
||||
]
|
||||
, packages = ./packages.dhall
|
||||
, sources = [ "src/**/*.purs" ]
|
||||
|
@ -50,7 +50,7 @@ type ParsingErrorInfo =
|
||||
, jsonParsingError :: NonEmptyList ForeignError
|
||||
}
|
||||
|
||||
type GraphQLClient'
|
||||
type GraphQLClient''
|
||||
(operation :: GraphQL)
|
||||
(gql :: Symbol)
|
||||
(i :: Row Type)
|
||||
@ -72,7 +72,27 @@ type GraphQLClient'
|
||||
type GraphQLClient =
|
||||
forall (operation :: GraphQL)
|
||||
(gql :: Symbol) (i :: Row Type) (o :: Row Type) (m :: Type -> Type) (e :: Type)
|
||||
. GraphQLClient' operation gql i o m e
|
||||
. GraphQLReqRes operation gql i o
|
||||
=> IsSymbol gql
|
||||
=> JSON.WriteForeign { | i }
|
||||
=> JSON.ReadForeign { | o }
|
||||
=> MonadAff m
|
||||
=> MonadThrow e m
|
||||
=> (NetworkErrorInfo -> e)
|
||||
-> (ParsingErrorInfo -> e)
|
||||
-> Gql operation
|
||||
-> Record i
|
||||
-> m { | o }
|
||||
|
||||
type GraphQLClientAff =
|
||||
forall (operation :: GraphQL) (gql :: Symbol) (i :: Row Type) (o :: Row Type)
|
||||
. GraphQLReqRes operation gql i o
|
||||
=> IsSymbol gql
|
||||
=> JSON.WriteForeign { | i }
|
||||
=> JSON.ReadForeign { | o }
|
||||
=> Gql operation
|
||||
-> Record i
|
||||
-> Aff { | o }
|
||||
|
||||
graphQL
|
||||
:: Endpoint
|
||||
|
@ -1,12 +1,13 @@
|
||||
module Test.Main where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Data.Foldable (for_)
|
||||
import Data.Maybe (Maybe(..))
|
||||
import Effect (Effect)
|
||||
import Effect.Aff (Milliseconds(..), launchAff_)
|
||||
import Effect.Class.Console as Log
|
||||
import GraphQL.FunDeps (class GraphQLReqRes, Gql(..), GraphQL, GraphQLClient, graphQL)
|
||||
import GraphQL.FunDeps (class GraphQLReqRes, Gql(..), GraphQL, GraphQLClientAff, graphQL)
|
||||
import Test.Spec (describe, it)
|
||||
import Test.Spec.Reporter.Console (consoleReporter)
|
||||
import Test.Spec.Runner (defaultConfig, runSpec')
|
||||
@ -48,7 +49,7 @@ instance graphqlReactFinlandConference ::
|
||||
}
|
||||
)
|
||||
|
||||
client :: GraphQLClient
|
||||
client :: GraphQLClientAff
|
||||
client = graphQL "https://api.react-finland.fi/graphql" []
|
||||
|
||||
main ∷ Effect Unit
|
||||
|
Loading…
Reference in New Issue
Block a user