Documentation
¶
Index ¶
- type Data
- type Engine
- type GQLError
- type GQLRequest
- type GQLResponse
- type QueryEngine
- func (e *QueryEngine) Connect() error
- func (e *QueryEngine) Disconnect() error
- func (e *QueryEngine) Do(ctx context.Context, payload interface{}, v interface{}) error
- func (e *QueryEngine) Name() string
- func (e *QueryEngine) ReplaceSchema(replace func(schema string) string)
- func (e *QueryEngine) Request(ctx context.Context, method string, path string, payload interface{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶ added in v0.2.0
type Data struct {
Result json.RawMessage `json:"result"`
}
type GQLError ¶
type GQLError struct { Message string `json:"error"` // note: the query-engine uses 'error' instead of 'message' Path []string `json:"path"` Extensions map[string]interface{} `json:"query"` }
GQLError is a GraphQL Error
type GQLRequest ¶
type GQLRequest struct { Query string `json:"query"` Variables map[string]interface{} `json:"variables"` }
GQLRequest is the payload for GraphQL queries
type GQLResponse ¶
type GQLResponse struct { Data Data `json:"data"` Errors []GQLError `json:"errors"` Extensions map[string]interface{} `json:"extensions"` }
GQLResponse is the payload for a GraphQL response
type QueryEngine ¶ added in v0.2.0
type QueryEngine struct { // Schema contains the prisma Schema Schema string // contains filtered or unexported fields }
func New ¶ added in v0.2.0
func New(schema string, hasBinaryTargets bool) *QueryEngine
func (*QueryEngine) Connect ¶ added in v0.2.0
func (e *QueryEngine) Connect() error
func (*QueryEngine) Disconnect ¶ added in v0.2.0
func (e *QueryEngine) Disconnect() error
func (*QueryEngine) Do ¶ added in v0.2.0
func (e *QueryEngine) Do(ctx context.Context, payload interface{}, v interface{}) error
Do sends the http Request to the query engine and unmarshals the response
func (*QueryEngine) Name ¶ added in v0.2.0
func (e *QueryEngine) Name() string
func (*QueryEngine) ReplaceSchema ¶ added in v0.2.0
func (e *QueryEngine) ReplaceSchema(replace func(schema string) string)
deprecated
Click to show internal directories.
Click to hide internal directories.