Documentation
¶
Overview ¶
Package graphqlhandler evaluates and execute GraphQL requests to the remote server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGraphQLQueryEmpty = errors.New("query is required for graphql proxy") ErrGraphQLUnsupportedQueryBatch = errors.New("graphql query batch is not supported") )
Functions ¶
func NewGraphQLHandler ¶
func NewGraphQLHandler( operation *schema.RelyProxyOperation, options *schema.NewRelyProxyHandlerOptions, ) (schema.RelyProxyHandler, error)
NewGraphQLHandler creates a GraphQL request from operation.
Types ¶
type GraphQLHandler ¶
type GraphQLHandler struct {
// contains filtered or unexported fields
}
GraphQLHandler implements the RelyProxyHandler interface for GraphQL proxy.
func ValidateGraphQLString ¶
func ValidateGraphQLString(query string) (*GraphQLHandler, error)
ValidateGraphQLString parses and validates the GraphQL query string.
func (*GraphQLHandler) Handle ¶
func (ge *GraphQLHandler) Handle( ctx context.Context, request *http.Request, options *schema.RelyProxyHandleOptions, ) (*http.Response, any, error)
Handle resolves the HTTP request and proxies that request to the remote server.
func (*GraphQLHandler) Type ¶
func (*GraphQLHandler) Type() schema.RelyProxyType
Type returns type of the current handler.
type GraphQLRequestBody ¶
type GraphQLRequestBody struct {
Query string `json:"query"`
OperationName string `json:"operationName,omitempty"`
Variables map[string]any `json:"variables,omitempty"`
Extensions map[string]any `json:"extensions,omitempty"`
}
GraphQLRequestBody represents a request body to a GraphQL server.
Click to show internal directories.
Click to hide internal directories.