graphjin 3.8.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -185,6 +185,108 @@ Works from Node.js, Go, or any WebSocket client.
|
|
|
185
185
|
|
|
186
186
|
GraphJin exposes several tools that guide AI models to write valid queries. Key tools: `list_tables` and `describe_table` for schema discovery, `get_query_syntax` for learning the DSL, `execute_graphql` for running queries, and `execute_saved_query` for production-approved queries. Prompts like `write_query` and `fix_query_error` help models construct and debug queries.
|
|
187
187
|
|
|
188
|
+
## Chat Walkthroughs
|
|
189
|
+
|
|
190
|
+
Real conversations showing how an AI assistant uses GraphJin MCP tools to help you go from zero to running queries.
|
|
191
|
+
|
|
192
|
+
### "I have databases running but don't know the details"
|
|
193
|
+
|
|
194
|
+
> **You:** I have some databases running locally but I'm not sure about the ports or connection details. Can you help me set up GraphJin?
|
|
195
|
+
|
|
196
|
+
> **Claude:** Let me scan your system to find running databases.
|
|
197
|
+
>
|
|
198
|
+
> *calls `discover_databases`*
|
|
199
|
+
>
|
|
200
|
+
> I found 2 databases on your system:
|
|
201
|
+
> - **PostgreSQL** on localhost:5432 (TCP) — listening, auth: ok (user: postgres), databases: `myapp`, `myapp_test`
|
|
202
|
+
> - **MySQL** on localhost:3306 (TCP) — listening, auth: auth_failed — default credentials failed, provide username and password
|
|
203
|
+
>
|
|
204
|
+
> The PostgreSQL instance has databases `myapp` and `myapp_test`. Which one would you like to configure GraphJin with?
|
|
205
|
+
|
|
206
|
+
> **You:** Let's go with the "myapp" database on Postgres.
|
|
207
|
+
|
|
208
|
+
> **Claude:** I'll configure GraphJin to connect to your PostgreSQL database.
|
|
209
|
+
>
|
|
210
|
+
> *calls `update_current_config` with databases: {"main": {type: "postgres", host: "localhost", port: 5432, user: "postgres", dbname: "myapp"}}*
|
|
211
|
+
>
|
|
212
|
+
> Connected successfully! Let me see what tables you have.
|
|
213
|
+
>
|
|
214
|
+
> *calls `list_tables`*
|
|
215
|
+
>
|
|
216
|
+
> Your database has these tables: `users`, `orders`, `products`, `reviews`. Want me to write a query?
|
|
217
|
+
|
|
218
|
+
> **You:** Show me users with their orders.
|
|
219
|
+
|
|
220
|
+
> **Claude:** *calls `get_query_syntax` then `execute_graphql`*
|
|
221
|
+
> ```graphql
|
|
222
|
+
> { users { id name email orders { id total status } } }
|
|
223
|
+
> ```
|
|
224
|
+
> Here are the results — 24 users returned, each with their associated orders.
|
|
225
|
+
|
|
226
|
+
### "I have a Docker Compose project with MySQL"
|
|
227
|
+
|
|
228
|
+
> **You:** I'm running a Docker Compose stack with MySQL. Help me connect GraphJin to it.
|
|
229
|
+
|
|
230
|
+
> **Claude:** Let me check what database containers you have running.
|
|
231
|
+
>
|
|
232
|
+
> *calls `discover_databases`*
|
|
233
|
+
>
|
|
234
|
+
> Found a MySQL Docker container:
|
|
235
|
+
> - **MySQL** via Docker — container `myapp-db-1`, image `mysql:8.0`, port mapped to localhost:13306
|
|
236
|
+
>
|
|
237
|
+
> I'll configure GraphJin with the discovered connection details.
|
|
238
|
+
>
|
|
239
|
+
> *calls `update_current_config` with databases: {"main": {type: "mysql", host: "localhost", port: 13306, user: "root", dbname: ""}}*
|
|
240
|
+
>
|
|
241
|
+
> What's the database name and password for your MySQL instance?
|
|
242
|
+
|
|
243
|
+
> **You:** Database is "shop_db", password is "secret123".
|
|
244
|
+
|
|
245
|
+
> **Claude:** *calls `update_current_config` with the full credentials*
|
|
246
|
+
>
|
|
247
|
+
> Connected! Let me explore the schema.
|
|
248
|
+
>
|
|
249
|
+
> *calls `list_tables`*
|
|
250
|
+
>
|
|
251
|
+
> Tables found: `customers`, `products`, `orders`, `order_items`, `categories`. Let me check how they relate.
|
|
252
|
+
>
|
|
253
|
+
> *calls `explore_relationships` with table: "orders"*
|
|
254
|
+
>
|
|
255
|
+
> `orders` connects to `customers` (via customer_id) and `order_items` (via order_id), and `order_items` links to `products`. Here's a nested query:
|
|
256
|
+
>
|
|
257
|
+
> ```graphql
|
|
258
|
+
> { orders { id total customer { name email } order_items { quantity product { name price } } } }
|
|
259
|
+
> ```
|
|
260
|
+
|
|
261
|
+
### "I want to query my SQLite app database"
|
|
262
|
+
|
|
263
|
+
> **You:** I have a SQLite database file in my project. Can GraphJin work with it?
|
|
264
|
+
|
|
265
|
+
> **Claude:** Absolutely! Let me scan your project directory for SQLite files.
|
|
266
|
+
>
|
|
267
|
+
> *calls `discover_databases` with scan_dir: "."*
|
|
268
|
+
>
|
|
269
|
+
> Found 1 SQLite database:
|
|
270
|
+
> - **data/app.sqlite3** — file found
|
|
271
|
+
>
|
|
272
|
+
> I'll configure GraphJin to use it.
|
|
273
|
+
>
|
|
274
|
+
> *calls `update_current_config` with databases: {"main": {type: "sqlite", path: "data/app.sqlite3"}}*
|
|
275
|
+
>
|
|
276
|
+
> Connected! Let me see your tables.
|
|
277
|
+
>
|
|
278
|
+
> *calls `list_tables`*
|
|
279
|
+
>
|
|
280
|
+
> Tables: `tasks`, `projects`, `tags`, `task_tags`. Want to query something?
|
|
281
|
+
|
|
282
|
+
> **You:** Show me all tasks with their project name, sorted by due date.
|
|
283
|
+
|
|
284
|
+
> **Claude:** *calls `execute_graphql`*
|
|
285
|
+
> ```graphql
|
|
286
|
+
> { tasks(order_by: {due_date: asc}) { id title due_date completed project { name } } }
|
|
287
|
+
> ```
|
|
288
|
+
> Here are your 12 tasks sorted by due date, each showing the parent project name.
|
|
289
|
+
|
|
188
290
|
## Database Support
|
|
189
291
|
|
|
190
292
|
| Database | Queries | Mutations | Subscriptions | Full-Text | GIS |
|