feat: Initial GraphQL setup with remote WP schema

This commit is contained in:
2026-01-13 11:19:33 -05:00
parent a2860478a9
commit d0244eb6a3
8 changed files with 16425 additions and 70 deletions

View File

@@ -1,10 +1,11 @@
{ {
"files.associations": {
"*.css": "tailwindcss"
},
"editor.quickSuggestions": { "editor.quickSuggestions": {
"strings": "on" "strings": "on"
}, },
"files.associations": {
"*.css": "tailwindcss"
},
"graphql-config.load.rootDir": "wp-content/themes/moonshine",
"tailwindCSS.classAttributes": [ "tailwindCSS.classAttributes": [
"class", "class",
"ui" "ui"

View File

@@ -1,5 +1,10 @@
<script setup lang="ts">
const { data } = await useGraphQLQuery("GeneralSettings", undefined, { cache: { ttl: 0 } });
</script>
<template> <template>
<div> <div>
© {{ new Date().getFullYear() }} © {{ new Date().getFullYear() }}
<span v-if="data.generalSettings?.title">{{ data.generalSettings.title }}</span>
</div> </div>
</template> </template>

View File

@@ -0,0 +1,6 @@
query GeneralSettings {
generalSettings {
title
description
}
}

View File

@@ -0,0 +1,4 @@
{
"schema": "./server/graphql/schema.graphql",
"documents": "**/*.gql"
}

View File

@@ -2,6 +2,7 @@
export default defineNuxtConfig({ export default defineNuxtConfig({
modules: [ modules: [
"@lewebsimple/nuxt-graphql",
"@nuxt/eslint", "@nuxt/eslint",
"@nuxt/ui", "@nuxt/ui",
], ],
@@ -20,13 +21,6 @@ export default defineNuxtConfig({
colorMode: false, colorMode: false,
}, },
devServer: {
https: {
key: process.env.LOCAL_HTTPS_KEY,
cert: process.env.LOCAL_HTTPS_CERT,
},
},
compatibilityDate: "2026-01-01", compatibilityDate: "2026-01-01",
eslint: { eslint: {
@@ -40,4 +34,14 @@ export default defineNuxtConfig({
}, },
}, },
}, },
graphql: {
schemas: {
wp: {
type: "remote",
url: `${process.env.NUXT_WP_URL || "https://wp-headless.ledevsimple.ca"}/graphql`,
},
},
saveSdl: "server/graphql/schema.graphql",
},
}); });

View File

@@ -16,6 +16,7 @@
}, },
"dependencies": { "dependencies": {
"@iconify-json/lucide": "^1.2.84", "@iconify-json/lucide": "^1.2.84",
"@lewebsimple/nuxt-graphql": "^0.3.4",
"@nuxt/ui": "4.3.0", "@nuxt/ui": "4.3.0",
"nuxt": "^4.2.2", "nuxt": "^4.2.2",
"tailwindcss": "^4.1.18", "tailwindcss": "^4.1.18",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff