refactor(api): expose GraphQL transport snapshot flag
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
4725b39049
commit
51b176c1cf
2 changed files with 5 additions and 0 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue