Skip to content

Add possibility to extend options with path to config file

Pre-release
Pre-release
Compare
Choose a tag to compare
@dohomi dohomi released this 08 Jul 06:52

To fix most recent issues additionally to a simple object based setup you can now add a path to a config file to have full support to provide your own functions (which wasn't possible before this release)

// nuxt.config.js
apollo:{
  clientConfigs:{
    default: '~/plugins/apollo-default-config.js'
  }
}
// plugins/apollo-default-config.js
export default function(context){
  return {
   httpEndpoint: 'localhost:4000/graphql',
   getAuth: () => 'Bearer my-static-api-token'
 }
}

This is partly a breaking change. In case you passed a getAuth function as options you need to change your config to a plugin based config shown above.