diff --git a/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/Common/Components/ApolloFederationSupport.tsx b/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/Common/Components/ApolloFederationSupport.tsx index eacdbf01cd7..515fc56cb66 100644 --- a/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/Common/Components/ApolloFederationSupport.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/components/Services/Data/Common/Components/ApolloFederationSupport.tsx @@ -24,7 +24,7 @@ export const ApolloFederationSupport = ({ } const isSupportForApolloFederationEnabled = - configData?.experimental_features.includes('apollo_federation'); + configData?.is_apollo_federation_enabled; return (
@@ -37,10 +37,16 @@ export const ApolloFederationSupport = ({ {!isSupportForApolloFederationEnabled ? (
Apollo federation is not enabled. To enable apollo federation support, - start the Hasura server with environment variable - - HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: "apollo_federation" - + set the{' '} + + project env variable + {' '} + or start the Hasura server with{' '} + + {' '} + environment variable{' '} + + HASURA_GRAPHQL_ENABLE_APOLLO_FEDERATION: "true"
) : (
diff --git a/frontend/libs/console/legacy-ce/src/lib/hooks/useServerConfig.ts b/frontend/libs/console/legacy-ce/src/lib/hooks/useServerConfig.ts index 109f312adca..a3b8e0ced9a 100644 --- a/frontend/libs/console/legacy-ce/src/lib/hooks/useServerConfig.ts +++ b/frontend/libs/console/legacy-ce/src/lib/hooks/useServerConfig.ts @@ -32,6 +32,7 @@ export interface ServerConfig { claims_format: string; }; is_prometheus_metrics_enabled: boolean; + is_apollo_federation_enabled: boolean; } export function useServerConfig( diff --git a/server/src-lib/Hasura/Server/API/Config.hs b/server/src-lib/Hasura/Server/API/Config.hs index 64a25bc6163..e77d2bbba21 100644 --- a/server/src-lib/Hasura/Server/API/Config.hs +++ b/server/src-lib/Hasura/Server/API/Config.hs @@ -18,7 +18,7 @@ import Hasura.Server.Auth import Hasura.Server.Auth.JWT import Hasura.Server.Init.Config (API (METRICS), AllowListStatus) import Hasura.Server.Init.FeatureFlag (FeatureFlag (..)) -import Hasura.Server.Types (ExperimentalFeature) +import Hasura.Server.Types (ApolloFederationStatus, ExperimentalFeature) import Hasura.Server.Version (Version, currentVersion) data FeatureFlagInfo = FeatureFlagInfo @@ -58,7 +58,8 @@ data ServerConfig = ServerConfig scfgExperimentalFeatures :: !(Set.HashSet ExperimentalFeature), scfgIsPrometheusMetricsEnabled :: !Bool, scfgDefaultNamingConvention :: !NamingCase, - scfgFeatureFlags :: !(Set.HashSet FeatureFlagInfo) + scfgFeatureFlags :: !(Set.HashSet FeatureFlagInfo), + scfgIsApolloFederationEnabled :: !ApolloFederationStatus } deriving (Show, Eq, Generic) @@ -78,6 +79,7 @@ runGetConfig :: Set.HashSet API -> NamingCase -> [(FeatureFlag, Text, Bool)] -> + ApolloFederationStatus -> ServerConfig runGetConfig functionPermsCtx @@ -90,7 +92,8 @@ runGetConfig experimentalFeatures enabledAPIs defaultNamingConvention - featureFlags = + featureFlags + apolloFederationStatus = ServerConfig currentVersion functionPermsCtx @@ -107,6 +110,7 @@ runGetConfig isPrometheusMetricsEnabled defaultNamingConvention featureFlagSettings + apolloFederationStatus where isPrometheusMetricsEnabled = METRICS `Set.member` enabledAPIs featureFlagSettings = diff --git a/server/src-lib/Hasura/Server/App.hs b/server/src-lib/Hasura/Server/App.hs index 0213f00f324..ae588053413 100644 --- a/server/src-lib/Hasura/Server/App.hs +++ b/server/src-lib/Hasura/Server/App.hs @@ -756,6 +756,7 @@ configApiGetHandler appStateRef = do acEnabledAPIs acDefaultNamingConvention featureFlagSettings + acApolloFederationStatus return (emptyHttpLogGraphQLInfo, JSONResp $ HttpResponse (encJFromJValue res) []) data HasuraApp = HasuraApp