Updates naming conventions

This commit is contained in:
Mike Solomon 2023-06-19 14:54:03 +03:00
parent 018f8c702b
commit de088099ad
3 changed files with 28 additions and 4 deletions

View File

@ -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" ]

View File

@ -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

View File

@ -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