Skip to content

Package v1alpha2 contains the API Schema definitions for WSO2 APK.

GQLRoute

GQLRoute is the Schema for the gqlroutes API

Field Description
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
GQLRouteSpec


CommonRouteSpec
sigs.k8s.io/gateway-api/apis/v1beta1.CommonRouteSpec

(Members of CommonRouteSpec are embedded into this type.)

hostnames
[]sigs.k8s.io/gateway-api/apis/v1beta1.Hostname
(Optional)

Hostnames defines a set of hostname that should match against the HTTP Host header to select a GQLRoute used to process the request.

backendRefs
[]sigs.k8s.io/gateway-api/apis/v1beta1.HTTPBackendRef

BackendRefs defines the backend(s) where matching requests should be sent.

rules
[]GQLRouteRules
(Optional)

Rules are a list of GraphQL resources, filters and actions.

status
GQLRouteStatus

GQLRouteFilter

(Appears on: GQLRouteRules)

GQLRouteFilter defines the filter to be applied to a request.

Field Description
extensionRef
sigs.k8s.io/gateway-api/apis/v1beta1.LocalObjectReference
(Optional)

ExtensionRef is an optional, implementation-specific extension to the “filter” behavior. For example, resource “myroutefilter” in group “networking.example.net”). ExtensionRef MUST NOT be used for core and extended filters.

Support: Implementation-specific

GQLRouteMatch

(Appears on: GQLRouteRules)

GQLRouteMatch defines the predicate used to match requests to a given action.

Field Description
type
GQLType
(Optional)

Type specifies GQL typematcher. When specified, this route will be matched only if the request has the specified method.

Support: Extended

path
string

Path specifies a GQL request resource matcher.

GQLRouteRules

(Appears on: GQLRouteSpec)

GQLRouteRules defines semantics for matching an GraphQL request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).

Field Description
matches
[]GQLRouteMatch

Matches define conditions used for matching the rule against incoming graphQL requests. Each match is independent, i.e. this rule will be matched if any one of the matches is satisfied.

filters
[]GQLRouteFilter

Filters define the filters that are applied to requests that match this rule.

GQLRouteSpec

(Appears on: GQLRoute)

GQLRouteSpec defines the desired state of GQLRoute

Field Description
CommonRouteSpec
sigs.k8s.io/gateway-api/apis/v1beta1.CommonRouteSpec

(Members of CommonRouteSpec are embedded into this type.)

hostnames
[]sigs.k8s.io/gateway-api/apis/v1beta1.Hostname
(Optional)

Hostnames defines a set of hostname that should match against the HTTP Host header to select a GQLRoute used to process the request.

backendRefs
[]sigs.k8s.io/gateway-api/apis/v1beta1.HTTPBackendRef

BackendRefs defines the backend(s) where matching requests should be sent.

rules
[]GQLRouteRules
(Optional)

Rules are a list of GraphQL resources, filters and actions.

GQLRouteStatus

(Appears on: GQLRoute)

GQLRouteStatus defines the observed state of GQLRoute

GQLType (string alias)

(Appears on: GQLRouteMatch)

GQLType describes how to select a GQL request by matching the GQL Type. The value is expected in upper case.

Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.

Unknown values here must result in the implementation setting the Accepted Condition for the Route to status: False, with a Reason of UnsupportedValue.


Generated with gen-crd-api-reference-docs.

GQLRoute Sample

The following is a sample GQLRoute CR.

apiVersion: dp.wso2.com/v1alpha2
kind: GQLRoute
metadata:
  name: graphql-api-route
spec:
  hostnames:
  - graphql.backend.gw.wso2.com
  backendRefs:
    - group: dp.wso2.com
      kind: Backend
      name: gql-backend
  rules:
  - matches:
    - path: hero
      type: QUERY
    - path: droid
      type: QUERY
    - path: reviews
      type: QUERY
    - path: search
      type: QUERY
    - path: character
      type: QUERY
    - path: allHumans
      type: QUERY
    - path: allDroids
      type: QUERY
    - path: allCharacters
      type: QUERY
    - path: starship
      type: QUERY
    - path: createReview
      type: MUTATION
    - path: human
      type: QUERY
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: wso2-apk-default
    namespace: apk
    sectionName: httpslistener