Skip to content

Commit 69369a7

Browse files
committed
Init Houdini
1 parent aff883a commit 69369a7

9 files changed

+257
-53
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ node_modules
88
!.env.example
99
vite.config.js.timestamp-*
1010
vite.config.ts.timestamp-*
11+
12+
$houdini

.graphqlrc.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
projects:
2+
default:
3+
schema:
4+
- ./schema.graphql
5+
- ./$houdini/graphql/schema.graphql
6+
documents:
7+
- '**/*.gql'
8+
- '**/*.svelte'
9+
- ./$houdini/graphql/documents.gql

houdini.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/// <references types="houdini-svelte">
2+
3+
/** @type {import('houdini').ConfigFile} */
4+
const config = {
5+
"watchSchema": {
6+
"url": "http://127.0.0.1:6969/query"
7+
},
8+
"plugins": {
9+
"houdini-svelte": {}
10+
}
11+
}
12+
13+
export default config

package.json

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
{
2-
"name": "dashboard3",
3-
"version": "0.0.1",
4-
"private": true,
5-
"scripts": {
6-
"dev": "vite dev",
7-
"build": "vite build",
8-
"preview": "vite preview",
9-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11-
"lint": "prettier --plugin-search-dir . --check . && eslint .",
12-
"format": "prettier --plugin-search-dir . --write ."
13-
},
14-
"devDependencies": {
15-
"@sveltejs/adapter-auto": "^2.0.0",
16-
"@sveltejs/kit": "^1.5.0",
17-
"@typescript-eslint/eslint-plugin": "^5.45.0",
18-
"@typescript-eslint/parser": "^5.45.0",
19-
"eslint": "^8.28.0",
20-
"eslint-config-prettier": "^8.5.0",
21-
"eslint-plugin-svelte3": "^4.0.0",
22-
"prettier": "^2.8.0",
23-
"prettier-plugin-svelte": "^2.8.1",
24-
"svelte": "^3.54.0",
25-
"svelte-check": "^3.0.1",
26-
"tslib": "^2.4.1",
27-
"typescript": "^5.0.0",
28-
"vite": "^4.2.0"
29-
},
30-
"type": "module"
31-
}
2+
"name": "dashboard3",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite dev",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
12+
"format": "prettier --plugin-search-dir . --write ."
13+
},
14+
"devDependencies": {
15+
"@sveltejs/adapter-auto": "^2.0.0",
16+
"@sveltejs/kit": "^1.5.0",
17+
"@typescript-eslint/eslint-plugin": "^5.45.0",
18+
"@typescript-eslint/parser": "^5.45.0",
19+
"eslint": "^8.28.0",
20+
"eslint-config-prettier": "^8.5.0",
21+
"eslint-plugin-svelte3": "^4.0.0",
22+
"prettier": "^2.8.0",
23+
"prettier-plugin-svelte": "^2.8.1",
24+
"svelte": "^3.54.0",
25+
"svelte-check": "^3.0.1",
26+
"tslib": "^2.4.1",
27+
"typescript": "^5.0.0",
28+
"vite": "^4.2.0",
29+
"houdini": "^1.2.2",
30+
"houdini-svelte": "^1.2.2"
31+
},
32+
"type": "module"
33+
}

schema.graphql

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
2+
3+
type App implements Node {
4+
env: Env!
5+
id: ID!
6+
image: String!
7+
instances: [Instance!]!
8+
name: String!
9+
}
10+
11+
type AppConnection {
12+
edges: [AppEdge!]!
13+
pageInfo: PageInfo!
14+
totalCount: Int!
15+
}
16+
17+
type AppEdge {
18+
cursor: Cursor!
19+
node: App!
20+
}
21+
22+
scalar Cursor
23+
24+
type Deployment {
25+
created: Time!
26+
env: String!
27+
id: ID!
28+
resources: [DeploymentResource!]!
29+
statuses: [DeploymentStatus!]!
30+
team: Team!
31+
type: String!
32+
}
33+
34+
type DeploymentConnection {
35+
edges: [DeploymentEdge!]!
36+
pageInfo: PageInfo!
37+
totalCount: Int!
38+
}
39+
40+
type DeploymentEdge {
41+
cursor: Cursor!
42+
node: Deployment!
43+
}
44+
45+
type DeploymentResource {
46+
group: String!
47+
id: ID!
48+
kind: String!
49+
name: String!
50+
namespace: String!
51+
version: String!
52+
}
53+
54+
type DeploymentStatus {
55+
created: Time!
56+
id: ID!
57+
message: String
58+
status: String!
59+
}
60+
61+
type Env implements Node {
62+
id: ID!
63+
name: String!
64+
}
65+
66+
type GithubRepository {
67+
name: String!
68+
}
69+
70+
type GithubRepositoryConnection {
71+
edges: [GithubRepositoryEdge!]!
72+
pageInfo: PageInfo!
73+
totalCount: Int!
74+
}
75+
76+
type GithubRepositoryEdge {
77+
cursor: Cursor!
78+
node: GithubRepository!
79+
}
80+
81+
type Instance implements Node {
82+
id: ID!
83+
name: String!
84+
status: String!
85+
}
86+
87+
interface Node {
88+
id: ID!
89+
}
90+
91+
type PageInfo {
92+
endCursor: Cursor
93+
hasNextPage: Boolean!
94+
hasPreviousPage: Boolean!
95+
startCursor: Cursor
96+
}
97+
98+
type Query {
99+
node(id: ID!): Node
100+
team(name: String!): Team!
101+
teams(after: Cursor, first: Int): TeamConnection!
102+
user: User!
103+
}
104+
105+
type SlackAlertsChannel {
106+
env: String!
107+
name: String!
108+
}
109+
110+
type Team implements Node {
111+
apps(after: Cursor, first: Int): AppConnection!
112+
deployments(after: Cursor, first: Int): DeploymentConnection!
113+
description: String
114+
githubRepositories(after: Cursor, first: Int): GithubRepositoryConnection!
115+
id: ID!
116+
members(after: Cursor, first: Int): TeamMemberConnection!
117+
name: String!
118+
slackAlertsChannels: [SlackAlertsChannel!]
119+
slackChannel: String
120+
}
121+
122+
type TeamConnection {
123+
edges: [TeamEdge!]!
124+
pageInfo: PageInfo!
125+
totalCount: Int!
126+
}
127+
128+
type TeamEdge {
129+
cursor: Cursor!
130+
node: Team!
131+
}
132+
133+
type TeamMember implements Node {
134+
email: String!
135+
id: ID!
136+
name: String!
137+
role: String!
138+
}
139+
140+
type TeamMemberConnection {
141+
edges: [TeamMemberEdge!]!
142+
pageInfo: PageInfo!
143+
totalCount: Int!
144+
}
145+
146+
type TeamMemberEdge {
147+
cursor: Cursor!
148+
node: TeamMember!
149+
}
150+
151+
"""
152+
Time is a string in [RFC 3339](https://rfc-editor.org/rfc/rfc3339.html) format, with sub-second precision added if present.
153+
"""
154+
scalar Time
155+
156+
type User implements Node {
157+
email: String!
158+
id: ID!
159+
name: String!
160+
teams(after: Cursor, first: Int): TeamConnection!
161+
}

src/client.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { HoudiniClient } from '$houdini';
2+
3+
export default new HoudiniClient({
4+
url: 'http://127.0.0.1:6969/query'
5+
6+
// uncomment this to configure the network call (for things like authentication)
7+
// for more information, please visit here: https://www.houdinigraphql.com/guides/authentication
8+
// fetchParams({ session }) {
9+
// return {
10+
// headers: {
11+
// Authentication: `Bearer ${session.token}`,
12+
// }
13+
// }
14+
// }
15+
})

svelte.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const config = {
88
preprocess: vitePreprocess(),
99

1010
kit: {
11-
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
12-
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
13-
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
14-
adapter: adapter()
11+
adapter: adapter(),
12+
alias: {
13+
$houdini: './$houdini',
14+
}
1515
}
1616
};
1717

tsconfig.json

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{
2-
"extends": "./.svelte-kit/tsconfig.json",
3-
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": true,
6-
"esModuleInterop": true,
7-
"forceConsistentCasingInFileNames": true,
8-
"resolveJsonModule": true,
9-
"skipLibCheck": true,
10-
"sourceMap": true,
11-
"strict": true
12-
}
13-
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
14-
//
15-
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16-
// from the referenced tsconfig.json - TypeScript does not merge them in
17-
}
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"checkJs": true,
6+
"esModuleInterop": true,
7+
"forceConsistentCasingInFileNames": true,
8+
"resolveJsonModule": true,
9+
"skipLibCheck": true,
10+
"sourceMap": true,
11+
"strict": true,
12+
"rootDirs": [
13+
".",
14+
"./.svelte-kit/types",
15+
"./$houdini/types"
16+
]
17+
}
18+
}

vite.config.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { sveltekit } from '@sveltejs/kit/vite';
2-
import { defineConfig } from 'vite';
1+
import { sveltekit } from '@sveltejs/kit/vite'
2+
import houdini from 'houdini/vite'
3+
import { defineConfig } from 'vite'
34

45
export default defineConfig({
5-
plugins: [sveltekit()]
6+
plugins: [houdini(), sveltekit()]
67
});

0 commit comments

Comments
 (0)