Skip to content

Commit 17cde57

Browse files
committed
Change tests to use AST.Node Nothing
Remove unused imports Remove redundant import `Name(Name)` Stop exporting mempty from Internal.Name
1 parent 61cc96b commit 17cde57

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/GraphQL/Internal/Name.hs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
{-# LANGUAGE ScopedTypeVariables #-}
77
module GraphQL.Internal.Name
88
( Name(unName, Name)
9-
, mempty
109
, NameError(..)
1110
, makeName
1211
, nameFromSymbol

tests/ASTTests.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Test.Tasty (TestTree)
1313
import Test.Tasty.Hspec (testSpec, describe, it, shouldBe)
1414

1515
import GraphQL.Value (String(..))
16-
import GraphQL.Internal.Name (Name (Name), mempty)
16+
import GraphQL.Internal.Name (Name)
1717
import qualified GraphQL.Internal.Syntax.AST as AST
1818
import qualified GraphQL.Internal.Syntax.Parser as Parser
1919
import qualified GraphQL.Internal.Syntax.Encoder as Encoder
@@ -106,7 +106,7 @@ tests = testSpec "AST" $ do
106106
let expected = AST.QueryDocument
107107
[ AST.DefinitionOperation
108108
(AST.Query
109-
(AST.Node (Name mempty) [] []
109+
(AST.Node Nothing [] []
110110
[ AST.SelectionField
111111
(AST.Field Nothing dog [] []
112112
[ AST.SelectionField (AST.Field Nothing someName [] [] [])
@@ -194,7 +194,7 @@ tests = testSpec "AST" $ do
194194
let expected = AST.QueryDocument
195195
[ AST.DefinitionOperation
196196
(AST.Query
197-
(AST.Node (Name mempty)
197+
(AST.Node Nothing
198198
[ AST.VariableDefinition
199199
(AST.Variable "atOtherHomes")
200200
(AST.TypeNamed (AST.NamedType "Boolean"))

tests/ValidationTests.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Test.QuickCheck ((===))
1010
import Test.Tasty (TestTree)
1111
import Test.Tasty.Hspec (testSpec, describe, it, shouldBe)
1212

13-
import GraphQL.Internal.Name (Name(Name), mempty)
13+
import GraphQL.Internal.Name (Name)
1414
import qualified GraphQL.Internal.Syntax.AST as AST
1515
import GraphQL.Internal.Schema (Schema)
1616
import GraphQL.Internal.Validation
@@ -52,7 +52,7 @@ tests = testSpec "Validation" $ do
5252
let doc = AST.QueryDocument
5353
[ AST.DefinitionOperation
5454
(AST.Query
55-
(AST.Node (Name mempty) [] []
55+
(AST.Node (Nothing) [] []
5656
[ AST.SelectionField
5757
(AST.Field Nothing dog [] []
5858
[ AST.SelectionField (AST.Field Nothing someName [] [] [])
@@ -65,7 +65,7 @@ tests = testSpec "Validation" $ do
6565
let doc = AST.QueryDocument
6666
[ AST.DefinitionOperation
6767
(AST.Query
68-
(AST.Node (Name mempty)
68+
(AST.Node Nothing
6969
[ AST.VariableDefinition
7070
(AST.Variable "atOtherHomes")
7171
(AST.TypeNamed (AST.NamedType "Boolean"))

0 commit comments

Comments
 (0)