Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
[TT-12132]:updated tbe gql config to mirror gateway config (#707)
Browse files Browse the repository at this point in the history
* updated tbe gql config to mirror gateway config

* make manifests run
  • Loading branch information
kofoworola authored May 22, 2024
1 parent 0a9b0e5 commit 48536b5
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 5 deletions.
21 changes: 20 additions & 1 deletion api/model/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ type HttpMethod string
// +kubebuilder:validation:Enum="";proxyOnly;executionEngine;supergraph;subgraph
type GraphQLExecutionMode string

// SubscriptionType is the subscription protocol to use for graphql subscriptions
// +kubebuilder:validation:Enum="";graphql-ws;graphql-transport-ws;sse
type SubscriptionType string

const (
SuperGraphExecutionMode GraphQLExecutionMode = "supergraph"
SubGraphExecutionMode GraphQLExecutionMode = "subgraph"
Expand Down Expand Up @@ -1191,9 +1195,24 @@ type GraphQLConfig struct {
Supergraph GraphQLSupergraphConfig `json:"supergraph,omitempty"`
}

type GraphQLResponseExtensions struct {
OnErrorForwarding bool `bson:"on_error_forwarding" json:"on_error_forwarding"`
}

type GraphQLProxyConfig struct {
// +nullable
AuthHeaders map[string]string `json:"auth_headers"`
AuthHeaders map[string]string `json:"auth_headers,omitempty"`
SubscriptionType SubscriptionType `json:"subscription_type,omitempty"`
// +nullable
RequestHeaders map[string]string `json:"request_headers,omitempty"`
UseResponseExtensions GraphQLResponseExtensions `json:"use_response_extensions,omitempty"`
// +nullable
RequestHeadersRewrite map[string]RequestHeadersRewriteConfig `json:"request_headers_rewrite,omitempty"`
}

type RequestHeadersRewriteConfig struct {
Value string `json:"value"`
Remove bool `json:"remove"`
}

type TypeFieldConfiguration struct {
Expand Down
47 changes: 47 additions & 0 deletions api/model/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 34 additions & 2 deletions config/crd/bases/tyk.tyk.io_apidefinitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,40 @@ spec:
type: string
nullable: true
type: object
required:
- auth_headers
request_headers:
additionalProperties:
type: string
nullable: true
type: object
request_headers_rewrite:
additionalProperties:
properties:
remove:
type: boolean
value:
type: string
required:
- remove
- value
type: object
nullable: true
type: object
subscription_type:
description: SubscriptionType is the subscription protocol
to use for graphql subscriptions
enum:
- ""
- graphql-ws
- graphql-transport-ws
- sse
type: string
use_response_extensions:
properties:
on_error_forwarding:
type: boolean
required:
- on_error_forwarding
type: object
type: object
schema:
description: Schema is the GraphQL Schema exposed by the GraphQL
Expand Down
35 changes: 33 additions & 2 deletions helm/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,39 @@ spec:
type: string
nullable: true
type: object
required:
- auth_headers
request_headers:
additionalProperties:
type: string
nullable: true
type: object
request_headers_rewrite:
additionalProperties:
properties:
remove:
type: boolean
value:
type: string
required:
- remove
- value
type: object
nullable: true
type: object
subscription_type:
description: SubscriptionType is the subscription protocol to use for graphql subscriptions
enum:
- ""
- graphql-ws
- graphql-transport-ws
- sse
type: string
use_response_extensions:
properties:
on_error_forwarding:
type: boolean
required:
- on_error_forwarding
type: object
type: object
schema:
description: Schema is the GraphQL Schema exposed by the GraphQL API/Upstream/Engine.
Expand Down

0 comments on commit 48536b5

Please sign in to comment.