Skip to content

Commit 6993dce

Browse files
committed
feat: nuxt-graphql-middleware schema validation
1 parent 102e84f commit 6993dce

File tree

18 files changed

+14112
-220
lines changed

18 files changed

+14112
-220
lines changed

package-lock.json

Lines changed: 3198 additions & 119 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"eslint-plugin-prettier": "^5.2.6",
6565
"happy-dom": "^13.3.8",
6666
"nuxt": "^3.16.2",
67+
"nuxt-graphql-middleware": "^5.0.0-alpha.17",
6768
"nuxt-language-negotiation": "^1.0.1",
6869
"postcss": "^8.4.35",
6970
"postcss-cli": "^11.0.0",
@@ -72,6 +73,7 @@
7273
"postcss-nested-import": "^1.3.0",
7374
"postcss-replace": "^2.0.1",
7475
"postcss-url": "^10.1.3",
75-
"tailwindcss": "^3.4.1"
76+
"tailwindcss": "^3.4.1",
77+
"vue-tsc": "^2.2.8"
7678
}
7779
}

playground/app/vuepal.adapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { defineVuepalAdapter } from './../../src/adapter'
2-
import { useCurrentLanguage } from '#imports'
2+
import { useCurrentLanguage, useGraphqlQuery } from '#imports'
33

44
export default defineVuepalAdapter(() => {
55
return {
66
getAdminMenu() {
7-
return $fetch('/api/adminMenu').then((v) => v.data || {})
7+
return useGraphqlQuery('adminToolbar').then((v) => v.data)
88
},
99
getLocalTasks() {
10-
return $fetch('/api/localTasks').then(
10+
return $fetch<any>('/api/localTasks').then(
1111
(v) => v.data.route.localTasks || [],
1212
)
1313
},

playground/nuxt.config.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
export default defineNuxtConfig({
22
ssr: false,
3-
modules: ['../src/module', 'nuxt-language-negotiation', '@nuxt/eslint'],
3+
modules: [
4+
'nuxt-graphql-middleware',
5+
'../src/module',
6+
'nuxt-language-negotiation',
7+
'@nuxt/eslint',
8+
],
9+
10+
graphqlMiddleware: {
11+
// For local development:
12+
// Set this to true to update the schema.
13+
// Make sure the starterkit app is running.
14+
downloadSchema: false,
15+
graphqlEndpoint: 'http://starterkit.ddev.site/de/graphql',
16+
schemaPath: './../schema.graphql',
17+
18+
codegenConfig: {
19+
skipUnusedFragments: false,
20+
},
21+
},
422

523
imports: {
624
autoImport: false,
@@ -51,6 +69,9 @@ export default defineNuxtConfig({
5169
langcodes: ['de', 'en'],
5270
outputPath: './../drupal/frontend_routing.settings.yml',
5371
},
72+
drupalRoute: {
73+
enabled: true,
74+
},
5475
},
5576

5677
compatibilityDate: '2024-09-10',
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
query route($path: String!) {
2+
...useDrupalRoute
3+
}

0 commit comments

Comments
 (0)