Skip to content

Commit cc19db3

Browse files
authored
docs(pylon.md): update to pylon v2
1 parent ae6e0ec commit cc19db3

File tree

1 file changed

+15
-5
lines changed
  • src/code/language-support/javascript/server

1 file changed

+15
-5
lines changed

src/code/language-support/javascript/server/pylon.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
---
22
name: Pylon
3-
description: A code-first approach to GraphQL API development that generates schemas from TypeScript in real-time, enhancing development speed, type safety, and error reduction, with instant reflection of code changes in the API. For more information, go to https://pylon.cronit.io
3+
description: A code-first framework for GraphQL API development, where your schema reflects your functionality. Run `npm create pylon@latest` to get started.
44
url: https://pylon.cronit.io
55
github: getcronit/pylon
66
---
77

8+
1. **Create**
9+
10+
```bash
11+
npm create pylon@latest
12+
```
13+
14+
2. **Develop**
15+
816
Example service:
917

1018
```typescript
11-
import { defineService } from "@getcronit/pylon"
19+
import { app } from "@getcronit/pylon"
1220

1321
class User {
1422
name: string
@@ -25,7 +33,7 @@ const users = [
2533
new User("Charlie", "[email protected]"),
2634
]
2735

28-
export default defineService({
36+
export const graphql = {
2937
Query: {
3038
users,
3139
user: (name: string) => {
@@ -39,10 +47,12 @@ export default defineService({
3947
},
4048
},
4149
},
42-
})
50+
}
51+
52+
export default app
4353
```
4454

45-
After running the service, you can query it using GraphQL:
55+
3. **Query**
4656

4757
```graphql
4858
query User {

0 commit comments

Comments
 (0)