Apoll config not work
Unanswered
khulood Batis posted this in #help-forum
my question how set configration apoll in nuxt3 to use graphql that i work laravel 11 api and nuxt 3 frontend
this index page
this config
this index page
<script lang="ts" setup>
const query = gql`
{ jobs(
orderBy: [{column:CREATED_AT ,order:DESC}],
){
id,
job_title,
}
}
`
const variables = { limit: 5 }
const { data } = await useAsyncQuery(query, variables)
</script>
<template>
<div>
<div class="text-center py-10 text-red-500">
<h1 class="text-4xl font-bold mb-2">Find the best jobs in the world.</h1>
<p class="text-gray-600 font-medium">
we're the best job board in the enrire world.
</p>
</div>
<div class="mt-10">
jobs index
</div>
</div>
</template>this config
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: false},
devServer :{
host: 'api.test'
},
modules: ["nuxt-auth-sanctum","@nuxtjs/apollo"],
apollo: {
clients: {
default: {
httpLinkOptions: {
credentials:'inculde'
},
httpEndpoint: 'http://api.test/graphiql'
}
},
},
sanctum:{
baseUrl: 'http://api.test',
redirect: {
onLogin: '/dashboard',
onAuthOnly: '/auth/login',
onGuestOnly: '/dashboard'
}
},
css: ['~/assets/css/app.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
})