mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
server/console: fix Apollo Federation UI to extend table types in other subgraphs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10071 Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com> GitOrigin-RevId: 5acbc792fd8b3fd9ae6a02ea740b3e13040b9c72
This commit is contained in:
parent
29bb76d6d3
commit
ed43fe9863
@ -24,7 +24,7 @@ export const ApolloFederationSupport = ({
|
||||
}
|
||||
|
||||
const isSupportForApolloFederationEnabled =
|
||||
configData?.experimental_features.includes('apollo_federation');
|
||||
configData?.is_apollo_federation_enabled;
|
||||
return (
|
||||
<div className="mb-lg">
|
||||
<div className="flex items-center mb-formlabel">
|
||||
@ -37,10 +37,16 @@ export const ApolloFederationSupport = ({
|
||||
{!isSupportForApolloFederationEnabled ? (
|
||||
<div className="font-thin">
|
||||
Apollo federation is not enabled. To enable apollo federation support,
|
||||
start the Hasura server with environment variable
|
||||
<code>
|
||||
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: "apollo_federation"
|
||||
</code>
|
||||
set the{' '}
|
||||
<a href="https://hasura.io/docs/latest/hasura-cloud/projects/env-vars/">
|
||||
project env variable
|
||||
</a>{' '}
|
||||
or start the Hasura server with{' '}
|
||||
<a href="https://hasura.io/docs/latest/deployment/graphql-engine-flags/index/#using-environment-variables">
|
||||
{' '}
|
||||
environment variable{' '}
|
||||
</a>
|
||||
<code>HASURA_GRAPHQL_ENABLE_APOLLO_FEDERATION: "true"</code>
|
||||
</div>
|
||||
) : (
|
||||
<div data-toggle="tooltip">
|
||||
|
@ -32,6 +32,7 @@ export interface ServerConfig {
|
||||
claims_format: string;
|
||||
};
|
||||
is_prometheus_metrics_enabled: boolean;
|
||||
is_apollo_federation_enabled: boolean;
|
||||
}
|
||||
|
||||
export function useServerConfig<T = ServerConfig>(
|
||||
|
@ -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 =
|
||||
|
@ -756,6 +756,7 @@ configApiGetHandler appStateRef = do
|
||||
acEnabledAPIs
|
||||
acDefaultNamingConvention
|
||||
featureFlagSettings
|
||||
acApolloFederationStatus
|
||||
return (emptyHttpLogGraphQLInfo, JSONResp $ HttpResponse (encJFromJValue res) [])
|
||||
|
||||
data HasuraApp = HasuraApp
|
||||
|
Loading…
Reference in New Issue
Block a user