Switch to @nuxtjs/apollo module-style integration
This commit is contained in:
@@ -1,23 +1,43 @@
|
||||
const nuxtPort = Number(process.env.NUXT_PORT || process.env.NITRO_PORT || process.env.PORT || 3000);
|
||||
const internalApolloBaseUrl = process.env.NUXT_INTERNAL_SITE_URL || `http://localhost:${nuxtPort}`;
|
||||
const authCookieName = process.env.AUTH_COOKIE_NAME || 'fregat_auth_token';
|
||||
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true },
|
||||
modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss'],
|
||||
modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss', '@nuxtjs/apollo'],
|
||||
css: ['~/assets/css/main.css'],
|
||||
runtimeConfig: {
|
||||
backendGraphqlUrl:
|
||||
process.env.NUXT_BACKEND_GRAPHQL_URL ||
|
||||
process.env.BACKEND_GRAPHQL_URL ||
|
||||
'http://localhost:4000/graphql',
|
||||
authCookieName,
|
||||
public: {
|
||||
graphqlEndpoint: process.env.NUXT_PUBLIC_GRAPHQL_ENDPOINT ?? 'http://localhost:4000/graphql',
|
||||
sentryDsn: process.env.NUXT_PUBLIC_SENTRY_DSN ?? '',
|
||||
sentryEnvironment: process.env.NUXT_PUBLIC_SENTRY_ENVIRONMENT ?? 'development',
|
||||
sentryRelease: process.env.NUXT_PUBLIC_SENTRY_RELEASE ?? 'dev',
|
||||
},
|
||||
},
|
||||
apollo: {
|
||||
proxyCookies: true,
|
||||
clients: {
|
||||
default: {
|
||||
httpEndpoint: `${internalApolloBaseUrl}/api/graphql`,
|
||||
browserHttpEndpoint: '/api/graphql',
|
||||
tokenStorage: 'cookie',
|
||||
tokenName: authCookieName,
|
||||
authType: 'Bearer',
|
||||
authHeader: 'Authorization',
|
||||
connectToDevTools: process.env.NODE_ENV !== 'production',
|
||||
},
|
||||
},
|
||||
},
|
||||
app: {
|
||||
head: {
|
||||
title: 'Fregat Client Cabinet',
|
||||
meta: [
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
],
|
||||
meta: [{ name: 'viewport', content: 'width=device-width, initial-scale=1' }],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user