Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a GraphQL client.
func New ¶
New creates a GraphQL client targeting the specified GraphQL server URL. If httpClient is nil, then http.DefaultClient with timeout is used.
type MockGraphqlServer ¶
type MockGraphqlServer struct {
CapturedReqHeaders []http.Header // the request's header that mocked server receives
CapturedReqBody []map[string]interface{} // the request (json unmarshalled) that mocked server receives
MockedRespBody [][]byte // the response (before json marshalling) that mocked server should return upon receiving request
URL string // URL to reach the server
Close func() error // for shutting down
// contains filtered or unexported fields
}
MockGraphqlServer would start a real httpserver, that records requests in sequence and returns given mocked responses in sequence
func (*MockGraphqlServer) Start ¶
func (s *MockGraphqlServer) Start(t *testing.T)
Click to show internal directories.
Click to hide internal directories.