1
- package handler_test
1
+ package handler
2
2
3
3
import (
4
4
"encoding/json"
@@ -13,7 +13,6 @@ import (
13
13
"context"
14
14
"github.com/graphql-go/graphql"
15
15
"github.com/graphql-go/graphql/testutil"
16
- "github.com/graphql-go/handler"
17
16
)
18
17
19
18
func decodeResponse (t * testing.T , recorder * httptest.ResponseRecorder ) * graphql.Result {
@@ -32,7 +31,8 @@ func decodeResponse(t *testing.T, recorder *httptest.ResponseRecorder) *graphql.
32
31
}
33
32
return & target
34
33
}
35
- func executeTest (t * testing.T , h * handler.Handler , req * http.Request ) (* graphql.Result , * httptest.ResponseRecorder ) {
34
+
35
+ func executeTest (t * testing.T , h * Handler , req * http.Request ) (* graphql.Result , * httptest.ResponseRecorder ) {
36
36
resp := httptest .NewRecorder ()
37
37
h .ServeHTTP (resp , req )
38
38
result := decodeResponse (t , resp )
@@ -67,7 +67,7 @@ func TestContextPropagated(t *testing.T) {
67
67
queryString := `query={name}`
68
68
req , _ := http .NewRequest ("GET" , fmt .Sprintf ("/graphql?%v" , queryString ), nil )
69
69
70
- h := handler . New (& handler. Config {
70
+ h := New (& Config {
71
71
Schema : & myNameSchema ,
72
72
Pretty : true ,
73
73
})
@@ -95,7 +95,7 @@ func TestHandler_BasicQuery_Pretty(t *testing.T) {
95
95
queryString := `query=query HeroNameQuery { hero { name } }`
96
96
req , _ := http .NewRequest ("GET" , fmt .Sprintf ("/graphql?%v" , queryString ), nil )
97
97
98
- h := handler . New (& handler. Config {
98
+ h := New (& Config {
99
99
Schema : & testutil .StarWarsSchema ,
100
100
Pretty : true ,
101
101
})
@@ -119,7 +119,7 @@ func TestHandler_BasicQuery_Ugly(t *testing.T) {
119
119
queryString := `query=query HeroNameQuery { hero { name } }`
120
120
req , _ := http .NewRequest ("GET" , fmt .Sprintf ("/graphql?%v" , queryString ), nil )
121
121
122
- h := handler . New (& handler. Config {
122
+ h := New (& Config {
123
123
Schema : & testutil .StarWarsSchema ,
124
124
Pretty : false ,
125
125
})
@@ -147,6 +147,6 @@ func TestHandler_Params_NilParams(t *testing.T) {
147
147
}
148
148
t .Fatalf ("expected to panic, did not panic" )
149
149
}()
150
- _ = handler . New (nil )
150
+ _ = New (nil )
151
151
152
152
}
0 commit comments