refactor(api): expose GraphQL transport snapshot flag

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 08:40:28 +00:00
parent 4725b39049
commit 51b176c1cf
2 changed files with 5 additions and 0 deletions

View file

@ -305,6 +305,9 @@ func TestEngine_Good_TransportConfigCarriesEngineMetadata(t *testing.T) {
if cfg.GraphQLPath != "/gql" {
t.Fatalf("expected graphql path /gql, got %q", cfg.GraphQLPath)
}
if !cfg.GraphQLEnabled {
t.Fatal("expected GraphQL to be enabled")
}
if !cfg.GraphQLPlayground {
t.Fatal("expected GraphQL playground to be enabled")
}

View file

@ -15,6 +15,7 @@ import "strings"
type TransportConfig struct {
SwaggerPath string
GraphQLPath string
GraphQLEnabled bool
GraphQLPlayground bool
WSPath string
SSEPath string
@ -36,6 +37,7 @@ func (e *Engine) TransportConfig() TransportConfig {
}
cfg := TransportConfig{
GraphQLEnabled: e.graphql != nil,
GraphQLPlayground: e.graphql != nil && e.graphql.playground,
PprofEnabled: e.pprofEnabled,
ExpvarEnabled: e.expvarEnabled,