feat: Initial GraphQL setup with remote WP schema
This commit is contained in:
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -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"
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
query GeneralSettings {
|
||||||
|
generalSettings {
|
||||||
|
title
|
||||||
|
description
|
||||||
|
}
|
||||||
|
}
|
||||||
4
wp-content/themes/moonshine/graphql.config.json
Normal file
4
wp-content/themes/moonshine/graphql.config.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"schema": "./server/graphql/schema.graphql",
|
||||||
|
"documents": "**/*.gql"
|
||||||
|
}
|
||||||
@@ -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",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
2555
wp-content/themes/moonshine/pnpm-lock.yaml
generated
2555
wp-content/themes/moonshine/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
13899
wp-content/themes/moonshine/server/graphql/schema.graphql
Normal file
13899
wp-content/themes/moonshine/server/graphql/schema.graphql
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user