Documentation ¶
Index ¶
- Constants
- func MergeJsonRightIntoLeft(left, right []byte) []byte
- func NewApiTransport(httpTransport *http.Transport, enableStreamingMode bool, ...) http.RoundTripper
- func NewRequestFromWunderGraphClientRequest(ctx context.Context, body []byte) (*http.Request, error)
- type Api
- type ApiTransport
- type ApiTransportFactory
- type ApiTransportOptions
- type Builder
- type BuilderConfig
- type Claims
- type CookieBasedSecrets
- type EndpointUnavailableHandler
- type FunctionsHandler
- type GraphQLHandler
- type GraphQLHandlerOptions
- type GraphQLPlaygroundHandler
- type InternalApiHandler
- type InternalBuilder
- type InternalBuilderConfig
- type InternalSubscriptionApiHandler
- type Listener
- type Logging
- type MutationHandler
- type OpenTelemetry
- type Options
- type PrometheusOptions
- type QueryHandler
- type QueryResolver
- type SubscriptionHandler
- type SubscriptionResolver
- type WgRequestParams
Constants ¶
View Source
const ( WgEnvCsrfSecret = "WG_CSRF_TOKEN_SECRET" WgEnvHashKey = "WG_SECURE_COOKIE_HASH_KEY" WgEnvBlockKey = "WG_SECURE_COOKIE_BLOCK_KEY" )
View Source
const ( WgInternalApiCallHeader = "X-WG-Internal-GraphQL-API" WgPrefix = "wg_" WgVariables = WgPrefix + "variables" WgLiveParam = WgPrefix + "live" WgJsonPatchParam = WgPrefix + "json_patch" WgSseParam = WgPrefix + "sse" WgSubscribeOnceParam = WgPrefix + "subscribe_once" )
View Source
const ( ErrMsgOperationParseFailed = "failed to parse operation: %w" ErrMsgOperationNormalizationFailed = "failed to normalize operation: %w" ErrMsgOperationValidationFailed = "operation validation failed: %w" ErrMsgOperationPlanningFailed = "operation planning failed: %w" )
Variables ¶
This section is empty.
Functions ¶
func MergeJsonRightIntoLeft ¶
MergeJsonRightIntoLeft merges the right JSON into the left JSON while overriding the left side
func NewApiTransport ¶
func NewApiTransport(httpTransport *http.Transport, enableStreamingMode bool, opts ApiTransportOptions) http.RoundTripper
Types ¶
type Api ¶ added in v0.110.0
type Api struct { PrimaryHost string Hosts []string EngineConfiguration *wgpb.EngineConfiguration EnableSingleFlight bool EnableGraphqlEndpoint bool Operations []*wgpb.Operation InvalidOperationNames []string CorsConfiguration *wgpb.CorsConfiguration ApiConfigHash string AuthenticationConfig *wgpb.ApiAuthenticationConfig S3UploadConfiguration []*wgpb.S3UploadConfiguration Webhooks []*wgpb.WebhookConfiguration Options *Options CookieBasedSecrets *CookieBasedSecrets }
func (*Api) HasCookieAuthEnabled ¶ added in v0.110.0
type ApiTransport ¶
type ApiTransport struct {
// contains filtered or unexported fields
}
type ApiTransportFactory ¶ added in v0.112.0
type ApiTransportFactory interface { RoundTripper(transport *http.Transport, enableStreamingMode bool) http.RoundTripper DefaultTransportTimeout() time.Duration DefaultHTTPProxyURL() *url.URL }
func NewApiTransportFactory ¶ added in v0.93.2
func NewApiTransportFactory(opts ApiTransportOptions) ApiTransportFactory
type ApiTransportOptions ¶ added in v0.144.0
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(pool *pool.Pool, log *zap.Logger, loader *engineconfigloader.EngineConfigLoader, hooksClient *hooks.Client, config BuilderConfig, ) *Builder
func (*Builder) BuildAndMountApiHandler ¶
type BuilderConfig ¶
type CookieBasedSecrets ¶ added in v0.131.2
func NewCookieBasedSecrets ¶ added in v0.131.2
func NewCookieBasedSecrets() (cookieBasedSecrets *CookieBasedSecrets, warnMessages []string)
func NewDevModeCookieBasedSecrets ¶ added in v0.131.2
func NewDevModeCookieBasedSecrets() (cookieBasedSecrets *CookieBasedSecrets, errorMessages []string)
type EndpointUnavailableHandler ¶
type EndpointUnavailableHandler struct {}
func (*EndpointUnavailableHandler) ServeHTTP ¶
func (m *EndpointUnavailableHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FunctionsHandler ¶ added in v0.126.0
type FunctionsHandler struct {
// contains filtered or unexported fields
}
func (*FunctionsHandler) ServeHTTP ¶ added in v0.126.0
func (h *FunctionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GraphQLHandler ¶
type GraphQLHandler struct {
// contains filtered or unexported fields
}
func (*GraphQLHandler) ServeHTTP ¶
func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GraphQLHandlerOptions ¶ added in v0.153.0
type GraphQLHandlerOptions struct { // GraphQLBaseURL indicates the base URL used by the playground to query the GraphQL API. // The GraphQL endpoint is determined as {GraphQLBaseURL}/graphql GraphQLBaseURL string Internal bool PlanConfig plan.Configuration Definition *ast.Document Resolver *resolve.Resolver RenameTypeNames []resolve.RenameTypeName Pool *pool.Pool Cache *ristretto.Cache Log *zap.Logger }
type GraphQLPlaygroundHandler ¶
type GraphQLPlaygroundHandler struct {
// contains filtered or unexported fields
}
func (*GraphQLPlaygroundHandler) ServeHTTP ¶
func (h *GraphQLPlaygroundHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request)
type InternalApiHandler ¶
type InternalApiHandler struct {
// contains filtered or unexported fields
}
func (*InternalApiHandler) ServeHTTP ¶
func (h *InternalApiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type InternalBuilder ¶
type InternalBuilder struct {
// contains filtered or unexported fields
}
func NewInternalBuilder ¶
func NewInternalBuilder(config InternalBuilderConfig) *InternalBuilder
type InternalBuilderConfig ¶ added in v0.153.0
type InternalSubscriptionApiHandler ¶ added in v0.129.0
type InternalSubscriptionApiHandler struct {
// contains filtered or unexported fields
}
func (*InternalSubscriptionApiHandler) ServeHTTP ¶ added in v0.129.0
func (h *InternalSubscriptionApiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MutationHandler ¶
type MutationHandler struct {
// contains filtered or unexported fields
}
func (*MutationHandler) ServeHTTP ¶
func (h *MutationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OpenTelemetry ¶ added in v0.157.0
type PrometheusOptions ¶ added in v0.154.0
type QueryHandler ¶
type QueryHandler struct {
// contains filtered or unexported fields
}
func (*QueryHandler) ServeHTTP ¶
func (h *QueryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type QueryResolver ¶
type SubscriptionHandler ¶
type SubscriptionHandler struct {
// contains filtered or unexported fields
}
func (*SubscriptionHandler) ServeHTTP ¶
func (h *SubscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SubscriptionResolver ¶ added in v0.131.1
type SubscriptionResolver interface {
ResolveGraphQLSubscription(ctx *resolve.Context, subscription *resolve.GraphQLSubscription, writer resolve.FlushWriter) (err error)
}
type WgRequestParams ¶ added in v0.131.1
func NewWgRequestParams ¶ added in v0.131.1
func NewWgRequestParams(r *http.Request) WgRequestParams
Click to show internal directories.
Click to hide internal directories.