Configure Apollo only on running phases #11754
-
Hi, I'm using GraphQL, so I setup the export default function MyApp(...) {
return (
<ApolloProvider client={buildClient()}>...</ApolloProvider>
)
} The function get_backend_uri() {
return process.env.BACKEND_URI + '/graphql'
}
export default function buildClient() {
const uri = get_backend_uri()
...
return new ApolloClient(...)
} The require('dotenv').config();
module.exports = {
env: {
BACKEND_URI: process.env.MY_BACKEND_URI
}
} The problem is : I don't have the How could I fix that ? I had "hope" to use the Even with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I've found a workaround by using the react-env package as shown in their nextjs example This is not very clean, but it makes the job by providing a way to load values "at runtime" |
Beta Was this translation helpful? Give feedback.
I've found a workaround by using the react-env package as shown in their nextjs example
This is not very clean, but it makes the job by providing a way to load values "at runtime"