@@ -197,14 +197,17 @@ const envFileHandler = async (
197197 customHost = region ?. cma ?. substring ( 8 ) ;
198198 }
199199
200- const getGraphqlHost = ( name ?: string ) : string => {
201- const normalizedRegion = name ?. toLowerCase ( ) ;
202- if ( ! normalizedRegion || normalizedRegion === 'na' || normalizedRegion === 'aws-na' ) {
203- return 'graphql.contentstack.com' ;
200+ const getGraphqlHost = ( ) : string => {
201+ if ( ! isPredefinedRegion ) {
202+ return cdnHost . replace ( '-cdn.' , '-graphql.' ) ;
204203 }
205- return `${ normalizedRegion } -graphql.contentstack.com` ;
204+ const normalizedRegion = regionName ?. toLowerCase ( ) ;
205+ if ( ! normalizedRegion || normalizedRegion === 'na' || normalizedRegion === 'aws-na' || normalizedRegion === 'us' ) {
206+ return cdnHost . replace ( 'cdn.' , 'graphql.' ) . replace ( '.io' , '.com' ) ;
207+ }
208+ return cdnHost . replace ( '-cdn.' , '-graphql.' ) ;
206209 } ;
207- const graphqlHost = getGraphqlHost ( regionName ) ;
210+ const graphqlHost = getGraphqlHost ( ) ;
208211
209212 let imageHostname : string ;
210213 if ( isPredefinedRegion && region ?. cda ) {
@@ -214,6 +217,7 @@ const envFileHandler = async (
214217 const baseHost = region . cda . replace ( / ^ h t t p s ? : \/ \/ / , '' ) . replace ( / ^ [ ^ . ] + \. / , '' ) ;
215218 imageHostname = `*-images.${ baseHost } ` ;
216219 } else {
220+ //default
217221 imageHostname = '*-images.contentstack.com' ;
218222 }
219223 const production = environmentVariables . environment === 'production' ? true : false ;
0 commit comments