git.iko.soy/rowtype-yoga/purescript-graphql
on master help sign in
Breaking changes for PureScript version 0.15.0
commit7f6df1ecaab7d31e706208381a7306322eb4c955 authorhendrikniemann <h.neverman@web.de> dateTue 4 Jul 2023, 19:35 (3 years ago) parent1be1dab
15 files changed+71−75
README.md+1−2 packages.dhall+1−1 src/GraphQL/DSL.purs+36−36 src/GraphQL/Execution.purs+2−2 src/GraphQL/Execution/Result.purs+2−1 src/GraphQL/Language.purs+1−1 src/GraphQL/Language/Parser.purs+4−4 src/GraphQL/Language/Printer.purs+3−3 src/GraphQL/Type/InputObjectType.purs+2−2 test/Execution.purs+7−11 test/Language/Parser.purs+1−1 test/Language/Parser/Field.purs+1−1 test/Language/Parser/Operation.purs+1−1 test/Language/Parser/Value.purs+7−7 test/Readme.purs+2−2
README.md+1−2
@@ -30,7 +30,6 @@ import Prelude
3030
3131import Data.Argonaut (stringify)
3232import Data.Map as Map
33−import Data.Symbol (SProxy(..))
3433import Effect (Effect)
3534import Effect.Console as Console
3635import GraphQL ((!>), (.>), (:>), (?>), graphql)
@@ -49,7 +48,7 @@ queryType =
4948 GraphQL.objectType "Query"
5049 .> "The root query type."
5150 :> GraphQL.field "hello" GraphQL.string
52− ?> GraphQL.arg GraphQL.string (SProxy :: SProxy "name")
51+ ?> GraphQL.arg GraphQL.string (Proxy :: Proxy "name")
5352 .> "A simple field that returns a greeting."
5453 !> (\{ name } _ -> pure $ "Hello, " <> name <> "!")
5554```
packages.dhall+1−1
@@ -1,5 +1,5 @@
11let upstream =
2− https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210302/packages.dhall sha256:20cc5b89cf15433623ad6f250f112bf7a6bd82b5972363ecff4abf1febb02c50
2+ https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220513/packages.dhall sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa
33
44let overrides = {=}
55
src/GraphQL/DSL.purs+36−36
@@ -12,7 +12,7 @@ import Data.List (List, fromFoldable, find)
1212import Data.Map (empty, insert, lookup)
1313import Data.Maybe (Maybe(..), fromMaybe)
1414import Data.Newtype (unwrap)
15−import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
15+import Data.Symbol (class IsSymbol, reflectSymbol)
1616import Data.Traversable (class Traversable, traverse)
1717import Data.Tuple (Tuple(..))
1818import Data.Variant as Variant
@@ -26,7 +26,7 @@ import GraphQL.Type.Introspection.Datatypes as IntrospectionTypes
2626import GraphQL.Type.ObjectType (Argument(..), ExecutableField(..), Field(..), ObjectType(..))
2727import GraphQL.Type.UnionType (UnionType(..), filterSelectionSet)
2828import Record as Record
29−import Type.Data.RowList (RLProxy(..))
29+import Type.Proxy (Proxy(..))
3030import Type.Row as Row
3131import Type.RowList as RL
3232import Unsafe.Coerce (unsafeCoerce)
@@ -177,12 +177,12 @@ nullableListField name t =
177177-- | ```purescript
178178-- | objectType "Query"
179179-- | :> field "hello" Scalar.string
180−-- | ?> arg Scalar.string (SProxy :: _ "name")
180+-- | ?> arg Scalar.string (Proxy :: _ "name")
181181-- | !> \{ name } parent -> pure $ "Hello " <> name
182182-- | ```
183−arg :: forall t a n. InputType t => IsSymbol n => t a -> SProxy n -> Tuple (SProxy n) (Argument a)
183+arg :: forall t a n. InputType t => IsSymbol n => t a -> Proxy n -> Tuple (Proxy n) (Argument a)
184184arg t _name =
185− Tuple (SProxy :: _ n) $
185+ Tuple (Proxy :: _ n) $
186186 Argument
187187 { description: Nothing
188188 , resolveValue: input t
@@ -200,7 +200,7 @@ arg t _name =
200200-- | ```purescript
201201-- | objectType "Query"
202202-- | :> field "hello" Scalar.string
203−-- | ?> optionalArg Scalar.string (SProxy :: _ "name")
203+-- | ?> optionalArg Scalar.string (Proxy :: _ "name")
204204-- | !> (\{ name } parent -> case name of
205205-- | Just n -> pure $ "Hello " <> name
206206-- | Nothing -> pure "Hello stranger"
@@ -211,10 +211,10 @@ optionalArg ::
211211 InputType t =>
212212 IsSymbol n =>
213213 t a ->
214− SProxy n ->
215− Tuple (SProxy n) (Argument (Maybe a))
214+ Proxy n ->
215+ Tuple (Proxy n) (Argument (Maybe a))
216216optionalArg t _name =
217− Tuple (SProxy :: _ n) $
217+ Tuple (Proxy :: _ n) $
218218 Argument
219219 { description: Nothing
220220 , resolveValue
@@ -245,7 +245,7 @@ inputObjectType name = InputObjectType \_ ->
245245 }
246246
247247
248−inputField :: forall t l a. IsSymbol l => InputType t => t a -> SProxy l -> InputField l a
248+inputField :: forall t l a. IsSymbol l => InputType t => t a -> Proxy l -> InputField l a
249249inputField inputType label = InputField
250250 { name: label
251251 , required: true
@@ -266,7 +266,7 @@ optionalInputField :: forall t l a.
266266 IsSymbol l =>
267267 InputType t =>
268268 t a ->
269− SProxy l ->
269+ Proxy l ->
270270 InputField l (Maybe a)
271271optionalInputField inputType label = InputField
272272 { name: label
@@ -426,7 +426,7 @@ instance argsDefToArgsParamImpl ::
426426 , ArgsFromRows largsd largsp argsd argsp
427427 , RL.ListToRow largsd argsd
428428 , RL.ListToRow largsp argsp ) => ArgsDefToArgsParam argsd argsp where
429− argsFromDefinition = argsFromRows (RLProxy :: RLProxy largsd) (RLProxy :: RLProxy largsp)
429+ argsFromDefinition = argsFromRows (Proxy :: Proxy largsd) (Proxy :: Proxy largsp)
430430
431431
432432-- | ArgsDefToArgsParam that works on row lists for matching implementations
@@ -437,8 +437,8 @@ class ArgsFromRows
437437 (argsp :: Row Type)
438438 where
439439 argsFromRows ::
440− RLProxy largsd ->
441− RLProxy largsp ->
440+ Proxy largsd ->
441+ Proxy largsp ->
442442 List AST.ArgumentNode ->
443443 ExecutionContext ->
444444 Record argsd ->
@@ -459,7 +459,7 @@ instance argsFromRowsCons ::
459459 argsp
460460 where
461461 argsFromRows _argsdProxy _argspProxy nodes variables argsd =
462− let key = SProxy :: SProxy l
462+ let key = Proxy :: Proxy l
463463 Argument argConfig = Record.get key argsd
464464 tailArgsDef = Record.delete key argsd :: Record targsd
465465 nameEquals (AST.ArgumentNode { name: AST.NameNode { value } }) =
@@ -472,8 +472,8 @@ instance argsFromRowsCons ::
472472 resolvedValue = lmap improveInputError $ argConfig.resolveValue valueNode variables
473473 tail =
474474 argsFromRows
475− (RLProxy :: RLProxy ltargsd)
476− (RLProxy :: RLProxy ltargsp)
475+ (Proxy :: Proxy ltargsd)
476+ (Proxy :: Proxy ltargsp)
477477 nodes
478478 variables
479479 tailArgsDef
@@ -495,7 +495,7 @@ withArgument :: forall m a arg n argsdold argsdnew argspold argspnew.
495495 ArgsDefToArgsParam argsdold argspold =>
496496 ArgsDefToArgsParam argsdnew argspnew =>
497497 Field m a argsdold argspold ->
498− Tuple (SProxy n) (Argument arg) ->
498+ Tuple (Proxy n) (Argument arg) ->
499499 Field m a argsdnew argspnew
500500withArgument (Field fieldConfig) (Tuple proxy argument) =
501501 Field $ fieldConfig { args = args', serialize = serialize', argumentIntrospections = intros' }
@@ -530,7 +530,7 @@ withArgument (Field fieldConfig) (Tuple proxy argument) =
530530-- | ```purescript
531531-- | objectType "Query"
532532-- | :> field "hello" Scalar.string
533−-- | ?> arg (SProxy :: SProxy "name") Scalar.string
533+-- | ?> arg (Proxy :: Proxy "name") Scalar.string
534534-- | !> (\{ name } parent -> "Hello " <> name <> "!")
535535-- | ```
536536infixl 7 withArgument as ?>
@@ -616,7 +616,7 @@ withInputField :: forall l a r1 r2.
616616withInputField (InputObjectType objConfig) (InputField inputConfig) = InputObjectType (\_ ->
617617 let
618618 config = (objConfig unit)
619− fieldLabel = (SProxy :: SProxy l)
619+ fieldLabel = (Proxy :: Proxy l)
620620 fieldName = reflectSymbol fieldLabel
621621
622622 -- This function calls the old input function recursively and then also reads the new field
@@ -706,11 +706,11 @@ instance unionDefinitionInstance ::
706706 , RL.ListToRow varRowList varRow ) => UnionDefinition defRow varRow ctx where
707707 union name defRecord =
708708 let
709− typeIntrospections = unionIntrospection (RLProxy :: RLProxy defRowList) defRecord
709+ typeIntrospections = unionIntrospection (Proxy :: Proxy defRowList) defRecord
710710 output selectionSetNode execCtx ctxValue = ctxValue >>=
711711 unionResolver
712− (RLProxy :: RLProxy defRowList)
713− (RLProxy :: RLProxy varRowList)
712+ (Proxy :: Proxy defRowList)
713+ (Proxy :: Proxy varRowList)
714714 defRecord
715715 selectionSetNode
716716 execCtx
@@ -723,7 +723,7 @@ class UnionIntrospection
723723 (defRow :: Row Type)
724724 where
725725 unionIntrospection ::
726− RLProxy defRowList ->
726+ Proxy defRowList ->
727727 Record defRow ->
728728 Array IntrospectionTypes.TypeIntrospection
729729
@@ -738,13 +738,13 @@ instance unionIntrospectionCons ::
738738 where
739739 unionIntrospection _ defRecord =
740740 let
741− ObjectType configFn = Record.get (SProxy :: SProxy l) defRecord
741+ ObjectType configFn = Record.get (Proxy :: Proxy l) defRecord
742742 config = configFn unit
743743 in
744744 -- Recursively call function
745745 Array.cons config.introspection $
746746 unionIntrospection
747− (RLProxy :: RLProxy defRowListTail)
747+ (Proxy :: Proxy defRowListTail)
748748 -- We will just read from this value
749749 (unsafeCoerce defRecord :: Record defRowTail)
750750
@@ -760,8 +760,8 @@ class UnionResolver
760760 (ctx :: Type -> Type)
761761 where
762762 unionResolver ::
763− RLProxy defRowList ->
764− RLProxy varRowList ->
763+ Proxy defRowList ->
764+ Proxy varRowList ->
765765 Record defRow ->
766766 Maybe AST.SelectionSetNode ->
767767 ExecutionContext ->
@@ -786,18 +786,18 @@ instance unionResolverCons ::
786786 ctx
787787 where
788788 unionResolver ::
789− RLProxy (RL.Cons l (ObjectType ctx a) defRowListTail) ->
790− RLProxy (RL.Cons l a varRowListTail) ->
789+ Proxy (RL.Cons l (ObjectType ctx a) defRowListTail) ->
790+ Proxy (RL.Cons l a varRowListTail) ->
791791 Record defRow ->
792792 Maybe AST.SelectionSetNode ->
793793 ExecutionContext ->
794794 (Variant.Variant varRow) ->
795795 ctx Result
796− unionResolver _defRLProxy _varRLProxy _defRecord Nothing _execCtx =
796+ unionResolver _defProxy _varProxy _defRecord Nothing _execCtx =
797797 const $ throwError $ error "Missing selection set for union type"
798− unionResolver _defRLProxy _varRLProxy defRecord (Just selection) execCtx =
798+ unionResolver _defProxy _varProxy defRecord (Just selection) execCtx =
799799 let
800− objectType@(ObjectType config) = Record.get (SProxy :: SProxy l) defRecord
800+ objectType@(ObjectType config) = Record.get (Proxy :: Proxy l) defRecord
801801 typename = (config unit).name
802802 filteredSelection = filterSelectionSet typename selection execCtx
803803 recResolver ::
@@ -805,14 +805,14 @@ instance unionResolverCons ::
805805 ctx Result
806806 recResolver =
807807 unionResolver
808− (RLProxy :: RLProxy defRowListTail)
809− (RLProxy :: RLProxy varRowListTail)
808+ (Proxy :: Proxy defRowListTail)
809+ (Proxy :: Proxy varRowListTail)
810810 (unsafeCoerce defRecord :: Record defRowTail)
811811 (Just selection)
812812 execCtx
813813 in
814814 recResolver
815− # Variant.on (SProxy :: SProxy l)
815+ # Variant.on (Proxy :: Proxy l)
816816 (pure >>> output objectType (Just filteredSelection) execCtx)
817817
818818else instance unionResolverNil :: Functor ctx => UnionResolver RL.Nil RL.Nil defRow varRow ctx where
src/GraphQL/Execution.purs+2−2
@@ -6,7 +6,6 @@ import Control.Monad.Error.Class (class MonadError, throwError)
66import Data.Argonaut.Core (Json)
77import Data.List (List(..), find)
88import Data.Maybe (Maybe(..), fromMaybe, maybe)
9−import Data.Symbol (SProxy(..))
109import Effect.Exception (Error, error)
1110import GraphQL.Builtin.Introspection (schemaType, typeType)
1211import GraphQL.Builtin.Scalar as Scalar
@@ -16,6 +15,7 @@ import GraphQL.Language.AST (DefinitionNode(..), DocumentNode(..), NameNode(..),
1615import GraphQL.Type (ObjectType, Schema(..), ExecutionContext, output, introspect)
1716import GraphQL.Type.Introspection.Datatypes (SchemaIntrospection(..), TypeIntrospection)
1817import GraphQL.Type.Introspection.Util (findTypeByName)
18+import Type.Proxy (Proxy(..))
1919
2020
2121-- | This function is mostly used internally. If you just want to execute a GraphQL query you should
@@ -58,7 +58,7 @@ execute (DocumentNode { definitions }) (Schema s) variables operation root = do
5858 :> field "__schema" (schemaType :: ObjectType m SchemaIntrospection)
5959 !#> const schemaIntrospection
6060 :> nullableField "__type" (typeType :: ObjectType m TypeIntrospection)
61− ?> arg Scalar.string (SProxy :: _ "name")
61+ ?> arg Scalar.string (Proxy :: _ "name")
6262 !> ( \args _ -> pure $ findTypeByName args.name schemaIntrospection )
6363 in
6464 output metaQuery (Just selectionSet) variables root
src/GraphQL/Execution/Result.purs+2−1
@@ -4,8 +4,9 @@ import Prelude
44
55import Data.Argonaut.Core (Json, fromNumber, fromString, jsonEmptyObject, jsonNull)
66import Data.Argonaut.Encode (class EncodeJson, encodeJson, (:=), (~>))
7+import Data.FunctorWithIndex (mapWithIndex)
78import Data.Int as Int
8−import Data.List (List(..), foldl, mapWithIndex, null, singleton, (:))
9+import Data.List (List(..), foldl, null, singleton, (:))
910import Data.Maybe (Maybe, maybe)
1011import Data.Tuple (Tuple(..), fst, snd)
1112
src/GraphQL/Language.purs+1−1
@@ -6,7 +6,7 @@ import Data.Bifunctor (lmap)
66import Data.Either (Either)
77import GraphQL.Language.AST (DocumentNode)
88import GraphQL.Language.Parser (document)
9−import Text.Parsing.StringParser (runParser)
9+import StringParser (runParser)
1010
1111-- | Parse a query string and return a parsed GraphQL document or an error.
1212parse :: String -> Either String DocumentNode
src/GraphQL/Language/Parser.purs+4−4
@@ -16,10 +16,10 @@ import Data.List (List(..), toUnfoldable)
1616import Data.Maybe (Maybe(..), fromMaybe)
1717import Data.String.CodeUnits (fromCharArray)
1818import GraphQL.Language.AST as AST
19−import Text.Parsing.StringParser (Parser, try, fail)
20−import Text.Parsing.StringParser.CodePoints (regex, string)
21−import Text.Parsing.StringParser.CodeUnits (char, noneOf)
22−import Text.Parsing.StringParser.Combinators (between, many, optionMaybe)
19+import StringParser (Parser, try, fail)
20+import StringParser.CodePoints (regex, string)
21+import StringParser.CodeUnits (char, noneOf)
22+import StringParser.Combinators (between, many, optionMaybe)
2323
2424parens :: forall a. Parser a -> Parser a
2525parens = between (char '(') (char ')')
src/GraphQL/Language/Printer.purs+3−3
@@ -27,7 +27,7 @@ text :: String -> Doc
2727text str = Text str Nil
2828
2929line :: Doc
30−line = Line 0 Nil
30+line = Line 0 Nil
3131
3232nest :: Int -> Doc -> Doc
3333nest indent Nil = Nil
@@ -70,9 +70,9 @@ printValueNode (AST.BooleanValueNode { value }) = if value then text "true" else
7070printValueNode AST.NullValueNode = text "null"
7171printValueNode (AST.EnumValueNode { name }) = printNameNode name
7272printValueNode (AST.ListValueNode { values }) =
73− text "[" <> intercalate (text ", ") (map printValueNode values) <> text "]"
73+ text "[" <> intercalate (text ", ") (map printValueNode values) <> text "]"
7474printValueNode (AST.ObjectValueNode { fields }) =
75− text "{" <> intercalate (text ", ") (map printObjectFieldNode fields) <> text "}"
75+ text "{" <> intercalate (text ", ") (map printObjectFieldNode fields) <> text "}"
7676
7777printBlockString :: String -> Doc
7878printBlockString str =
src/GraphQL/Type/InputObjectType.purs+2−2
@@ -6,10 +6,10 @@ import Control.Lazy (class Lazy)
66import Data.Either (Either)
77import Data.Maybe (Maybe)
88import Data.Newtype (class Newtype, unwrap)
9−import Data.Symbol (SProxy)
109import GraphQL.Language.AST as AST
1110import GraphQL.Type.Class (class GraphQLType, class InputType, ExecutionContext)
1211import GraphQL.Type.Introspection.Datatypes as IntrospectionTypes
12+import Type.Proxy (Proxy)
1313
1414
1515newtype InputObjectType a = InputObjectType (Unit ->
@@ -42,7 +42,7 @@ instance lazyInputObjectType :: Lazy (InputObjectType a) where
4242
4343
4444newtype InputField l a = InputField
45− { name :: SProxy l
45+ { name :: Proxy l
4646 , required :: Boolean
4747 , introspection :: IntrospectionTypes.InputValueIntrospection
4848 , input :: Maybe AST.ValueNode -> ExecutionContext -> Either String a
test/Execution.purs+7−11
@@ -8,19 +8,17 @@ import Data.Bounded.Generic (genericBottom, genericTop)
88import Data.Either (Either(..), either)
99import Data.Enum (class Enum)
1010import Data.Enum.Generic (genericPred, genericSucc)
11−import Data.Eq.Generic (genericEq)
1211import Data.Generic.Rep (class Generic)
1312import Data.Map as Map
1413import Data.Maybe (Maybe(..), fromMaybe)
1514import Data.Newtype (class Newtype, unwrap)
16−import Data.Ord.Generic (genericCompare)
1715import Data.String (trim)
18−import Data.Symbol (SProxy(..))
1916import Effect.Aff (Aff, Error, throwError, error)
2017import GraphQL ((!!>), (!#>), (!>), (.>), (:>), (?>))
2118import GraphQL as GQL
2219import Test.Spec (Spec, describe, it)
2320import Test.Spec.Assertions (fail, shouldEqual)
21+import Type.Proxy (Proxy(..))
2422
2523-- Some data types for out upcoming tests
2624
@@ -32,11 +30,9 @@ data UserLevel = NormalUser | Moderator | Admin
3230
3331derive instance genericUserLevel :: Generic UserLevel _
3432
35−instance eqUserLevel :: Eq UserLevel where
36− eq = genericEq
33+derive instance Eq UserLevel
3734
38−instance ordUserLevel :: Ord UserLevel where
39− compare = genericCompare
35+derive instance Ord UserLevel
4036
4137instance boundedUserLevel :: Bounded UserLevel where
4238 top = genericTop
@@ -65,7 +61,7 @@ queryType =
6561 !> (\_ p -> pure $ "Hello " <> p <> "!")
6662 :> GQL.field "greet" GQL.string
6763 .> "A field that takes a name and responds with a presonalized greeting."
68− ?> GQL.arg GQL.string (SProxy :: SProxy "name")
64+ ?> GQL.arg GQL.string (Proxy :: Proxy "name")
6965 !> (\{ name } _ -> pure $ "Greetings " <> name <> "!")
7066 :> GQL.field "test" GQL.int
7167 !#> const 42
@@ -76,13 +72,13 @@ queryType =
7672 :> GQL.nullableField "nullable" GQL.float
7773 !#> (const Nothing)
7874 :> GQL.field "reflect" GQL.string
79− ?> GQL.arg userLevelType (SProxy :: _ "argIn")
75+ ?> GQL.arg userLevelType (Proxy :: _ "argIn")
8076 !> (\{ argIn } _ -> pure $ show argIn)
8177 :> GQL.field "reflectStringOptional" GQL.string
82− ?> GQL.optionalArg GQL.string (SProxy :: _ "argIn")
78+ ?> GQL.optionalArg GQL.string (Proxy :: _ "argIn")
8379 !> (\{ argIn } _ -> pure $ fromMaybe "default" argIn)
8480 :> GQL.field "toggle" GQL.boolean
85− ?> GQL.arg GQL.boolean (SProxy :: _ "on")
81+ ?> GQL.arg GQL.boolean (Proxy :: _ "on")
8682 !> (\{ on: onArg } _ -> pure $ not onArg)
8783 :> GQL.nullableField "fail" GQL.boolean
8884 !!> (\_ -> throwError $ error "Always fails at runtime.")
test/Language/Parser.purs+1−1
@@ -10,7 +10,7 @@ import Test.GraphQL.Language.Parser.Operation (parserOperationSpec)
1010import Test.GraphQL.Language.Parser.Value (valueSpec)
1111import Test.Spec (Spec, describe, it)
1212import Test.Spec.Assertions (shouldEqual)
13−import Text.Parsing.StringParser (runParser)
13+import StringParser (runParser)
1414
1515parserSpec :: Spec Unit
1616parserSpec =
test/Language/Parser/Field.purs+1−1
@@ -9,7 +9,7 @@ import GraphQL.Language.AST (ArgumentNode(..), DirectiveNode, NameNode(..), Sele
99import GraphQL.Language.Parser (selection)
1010import Test.Spec (Spec, describe, it)
1111import Test.Spec.Assertions (shouldEqual)
12−import Text.Parsing.StringParser (runParser)
12+import StringParser (runParser)
1313
1414baseField ::
1515 { alias :: Maybe NameNode
test/Language/Parser/Operation.purs+1−1
@@ -9,7 +9,7 @@ import GraphQL.Language.AST as AST
99import GraphQL.Language.Parser (document)
1010import Test.Spec (Spec, describe, it)
1111import Test.Spec.Assertions (shouldEqual)
12−import Text.Parsing.StringParser (runParser)
12+import StringParser (runParser)
1313
1414type OperationConfig =
1515 { name :: Maybe AST.NameNode
test/Language/Parser/Value.purs+7−7
@@ -8,7 +8,7 @@ import GraphQL.Language.AST (NameNode(..), ObjectFieldNode(..), ValueNode(..))
88import GraphQL.Language.Parser (value)
99import Test.Spec (Spec, describe, it)
1010import Test.Spec.Assertions (shouldEqual)
11−import Text.Parsing.StringParser (runParser)
11+import StringParser (runParser)
1212
1313valueSpec :: Spec Unit
1414valueSpec =
@@ -18,7 +18,7 @@ valueSpec =
1818
1919 it "parses a simple string" $
2020 runParser value "\"some string\"" `shouldEqual` Right (StringValueNode {block: false, value: "some string"})
21−
21+
2222 it "parses integer values" do
2323 runParser value "1234" `shouldEqual` Right (IntValueNode {value: "1234"})
2424 runParser value "0" `shouldEqual` Right (IntValueNode {value: "0"})
@@ -26,27 +26,27 @@ valueSpec =
2626 runParser value "-0" `shouldEqual` Right (IntValueNode {value: "-0"})
2727 isLeft (runParser value "02384") `shouldEqual` true
2828 isLeft (runParser value "-02384") `shouldEqual` true
29−
29+
3030 it "parses float values" do
3131 runParser value "234.23476" `shouldEqual` Right (FloatValueNode {value: "234.23476"})
3232 runParser value "-1.2" `shouldEqual` Right (FloatValueNode {value: "-1.2"})
3333 runParser value "1234E72" `shouldEqual` Right (FloatValueNode {value: "1234E72"})
3434 runParser value "434E-2" `shouldEqual` Right (FloatValueNode {value: "434E-2"})
3535 isLeft (runParser value "-023.000") `shouldEqual` true
36−
36+
3737 it "parses boolean values" do
3838 runParser value "true" `shouldEqual` Right (BooleanValueNode {value: true})
3939 runParser value "false" `shouldEqual` Right (BooleanValueNode {value: false})
40−
40+
4141 it "parses null values" do
4242 runParser value "null" `shouldEqual` Right NullValueNode
43−
43+
4444 it "parses enum values" do
4545 runParser value "SOME_ENUM" `shouldEqual` Right (EnumValueNode {name: NameNode {value: "SOME_ENUM"}})
4646 runParser value "uglyEnum" `shouldEqual` Right (EnumValueNode {name: NameNode {value: "uglyEnum"}})
4747 runParser value "lower" `shouldEqual` Right (EnumValueNode {name: NameNode {value: "lower"}})
4848 runParser value "WITH0" `shouldEqual` Right (EnumValueNode {name: NameNode {value: "WITH0"}})
49−
49+
5050 it "parses list values" do
5151 let listOf1 = IntValueNode {value: "1"} : Nil
5252 runParser value "[]" `shouldEqual` Right (ListValueNode {values: Nil})
test/Readme.purs+2−2
@@ -5,7 +5,6 @@ import Prelude
55import Data.Argonaut.Core (stringify)
66import Data.Map as Map
77import Data.Maybe (Maybe(..))
8−import Data.Symbol (SProxy(..))
98import Effect (Effect)
109import Effect.Class (liftEffect)
1110import Effect.Console as Console
@@ -13,6 +12,7 @@ import GraphQL ((!>), (.>), (:>), (?>), graphql)
1312import GraphQL as GraphQL
1413import Test.Spec (Spec, describe, it)
1514import Test.Spec.Assertions (shouldEqual)
15+import Type.Proxy (Proxy(..))
1616
1717main :: Effect Unit
1818main = do
@@ -27,7 +27,7 @@ queryType =
2727 GraphQL.objectType "Query"
2828 .> "The root query type."
2929 :> GraphQL.field "hello" GraphQL.string
30− ?> GraphQL.arg GraphQL.string (SProxy :: SProxy "name")
30+ ?> GraphQL.arg GraphQL.string (Proxy :: Proxy "name")
3131 .> "A simple field that returns a greeting."
3232 !> (\{ name } _ -> pure $ "Hello, " <> name <> "!")
3333