webpack.config.js
function proxyConfig(path) {
  const config = {}

  const {endpointsExtension} = tryGetGraphQLProjectConfig()
  if (endpointsExtension) {
    const graphqlEndpoint = endpointsExtension.getEndpoint()

    const {url: target, headers} = graphqlEndpoint
    const changeOrigin = true

    const pathRewrite = {}
    pathRewrite[`^${path}`] = ''

    config[path] = {changeOrigin, headers, pathRewrite, target}
  }

  return config
}
function proxyConfig(path) {
  const config = {}

  const {endpointsExtension} = tryGetGraphQLProjectConfig()
  if (endpointsExtension) {
    const graphqlEndpoint = endpointsExtension.getEndpoint()

    const {url: target, headers} = graphqlEndpoint
    const changeOrigin = true

    const pathRewrite = {}
    pathRewrite[`^${path}`] = ''

    config[path] = {changeOrigin, headers, pathRewrite, target}
  }

  return config
}
function proxyConfig ( path ) { const config = { } const { endpointsExtension } = tryGetGraphQLProjectConfig ( ) if ( endpointsExtension ) { const graphqlEndpoint = endpointsExtension . getEndpoint ( ) const { url : target , headers } = graphqlEndpoint const changeOrigin = true const pathRewrite = { } pathRewrite [ ` ${ path } ` ] = '' config [ path ] = { changeOrigin , headers , pathRewrite , target } } return config }
Get webpack proxy configuration as per .graphqlconfig.
Get webpack proxy configuration as per . graphqlconfig .