+13
-11
notes/quickslice-migration.md
+13
-11
notes/quickslice-migration.md
···
63
63
64
64
```javascript
65
65
const client = await QuicksliceClient.create({
66
-
server: 'https://zzstoatzz-quickslice-status.fly.dev',
67
-
clientId: 'client_2mP9AwgVHkg1vaSpcWSsKw',
68
-
redirectUri: window.location.origin + '/',
66
+
server: 'https://your-app.fly.dev', // your quickslice instance
67
+
clientId: 'client_xxx', // from quickslice admin UI
68
+
redirectUri: window.location.origin + '/', // where OAuth redirects back
69
69
});
70
70
71
71
// start login
···
75
75
const { data } = await client.agent.getProfile({ actor: client.agent.session.did });
76
76
```
77
77
78
-
the redirect URI is just the root of your site (e.g., `https://status.zzstoatzz.io/`).
78
+
the `clientId` comes from registering an OAuth client in the quickslice admin UI. the redirect URI should match what you registered.
79
79
80
80
**GraphQL queries**
81
81
82
82
quickslice auto-generates a GraphQL API from your lexicons. querying status records looks like:
83
83
84
84
```javascript
85
-
const response = await fetch(`${CONFIG.server}/api/graphql`, {
85
+
const response = await fetch(`https://your-app.fly.dev/api/graphql`, {
86
86
method: 'POST',
87
87
headers: { 'Content-Type': 'application/json' },
88
88
body: JSON.stringify({
89
89
query: `
90
-
query GetStatuses($did: String!) {
91
-
ioZzstoatzzStatusRecords(
90
+
query GetRecords($did: String!) {
91
+
yourLexiconRecords(
92
92
where: { did: { eq: $did } }
93
93
orderBy: { createdAt: DESC }
94
94
first: 50
95
95
) {
96
-
nodes { uri did emoji text createdAt }
96
+
nodes { uri did createdAt /* your fields */ }
97
97
}
98
98
}
99
99
`,
···
101
101
})
102
102
});
103
103
```
104
+
105
+
the query name (`yourLexiconRecords`) is auto-generated from your lexicon ID - dots become camelCase (e.g., `io.example.foo` → `ioExampleFoos`).
104
106
105
107
no need to write resolvers or schema - it's all generated from the lexicon definitions.
106
108
···
134
136
135
137
```toml
136
138
[env]
137
-
EXTERNAL_BASE_URL = 'https://zzstoatzz-quickslice-status.fly.dev'
139
+
EXTERNAL_BASE_URL = 'https://your-app.fly.dev'
138
140
```
139
141
140
142
### PDS caching
···
146
148
```
147
149
┌─────────────────────────────────────────────────────────┐
148
150
│ cloudflare pages │
149
-
│ status.zzstoatzz.io │
151
+
│ your-frontend.com │
150
152
│ │
151
153
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
152
154
│ │ index.html │ │ app.js │ │ styles.css │ │
···
157
159
▼
158
160
┌─────────────────────────────────────────────────────────┐
159
161
│ fly.io │
160
-
│ zzstoatzz-quickslice-status.fly.dev │
162
+
│ your-app.fly.dev │
161
163
│ │
162
164
│ ┌─────────────────────────────────────────────────┐ │
163
165
│ │ quickslice │ │