Skip to content

Commit be4bdb4

Browse files
feat: add graphql-config dependency
fix: enhance graphql.config.ts generation logic to check for existing config file feat: create a new graphql.config.ts file with default schema and documents paths
1 parent 1f1d91d commit be4bdb4

File tree

4 files changed

+392
-4
lines changed

4 files changed

+392
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nitro-graphql",
33
"type": "module",
4-
"version": "0.0.21",
4+
"version": "0.0.23",
55
"packageManager": "pnpm@10.13.1",
66
"description": "GraphQL integration for Nitro",
77
"license": "MIT",
@@ -86,6 +86,7 @@
8686
"chokidar": "^4.0.3",
8787
"consola": "^3.4.2",
8888
"defu": "^6.1.4",
89+
"graphql-config": "^5.1.5",
8990
"graphql-scalars": "^1.24.2",
9091
"knitwork": "^1.2.0",
9192
"ohash": "^2.0.11",

playground-nuxt/graphql.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
import type { IGraphQLConfig } from 'graphql-config'
3+
4+
export function createGraphQLConfig(config?: IGraphQLConfig): IGraphQLConfig {
5+
const newConfig: IGraphQLConfig = {
6+
projects: {
7+
default: {
8+
schema: [
9+
'./.nuxt/graphql/schema.graphql',
10+
],
11+
documents: [
12+
'./app/graphql/**/*.{graphql,js,ts,jsx,tsx}',
13+
],
14+
},
15+
},
16+
}
17+
return newConfig;
18+
}

0 commit comments

Comments
 (0)