You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SeaORM/docs/10-graph-ql/01-seaography-intro.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
If you are building a full-stack application with a web GUI these days, it's likely you'd use GraphQL as the communication interface between frontend and backend. However, building GraphQL resolvers is no easy task for backend developers.
4
4
5
-
[Seaography](https://github.com/SeaQL/seaography) is a GraphQL framework built on top of SeaORM and [async-graphql](https://github.com/async-graphql/async-graphql). With just a few commands, you can launch a GraphQL server from SeaORM entities!
5
+
[Seaography](https://github.com/SeaQL/seaography) is a GraphQL framework built on top of SeaORM and [async-graphql](https://github.com/async-graphql/async-graphql). Given a set of SeaORM entities, you can instantly launch a fully-featured GraphQL server / resolver with relational query, filters, pagination and mutations.
6
6
7
7
SeaORM is dynamic by design with first-class GraphQL support. `async-graphql``v5.0` introduced [dynamic schema](https://docs.rs/async-graphql/latest/async_graphql/dynamic/index.html) and is a perfect match with SeaORM.
Copy file name to clipboardExpand all lines: SeaORM/docs/10-graph-ql/02-getting-started.md
+154-8Lines changed: 154 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,32 +6,178 @@ This example can be found on [SeaORM + Seaography Example](https://github.com/Se
6
6
7
7
To get started, all you need is a live SQL database with schema. You can code everything in Rust by writing SeaORM migrations, or design the schema with a GUI tool (e.g. [DataGrip](https://www.jetbrains.com/datagrip/)).
Generate entities with `sea-orm-cli`, but with an additional `--seaography` flag. The entities are basically good-old SeaORM entities, but with additional `RelatedEntity` enum.
21
+
Generate entities with `sea-orm-cli` like you normally do, but with an additional `--seaography` flag. The entities are basically good-old SeaORM entities, but with an additional `RelatedEntity` enum.
Which web framework to use [default: poem] [possible values: actix, poem, axum]
116
+
--depth-limit <DEPTH_LIMIT>
117
+
GraphQL depth limit
118
+
--complexity-limit <COMPLEXITY_LIMIT>
119
+
GraphQL complexity limit
120
+
-h, --help
121
+
Print help
122
+
-V, --version
123
+
Print version
124
+
```
125
+
30
126
## Start the server
31
127
32
-
```bash
128
+
```sh
33
129
cd graphql
34
130
cargo run
35
131
```
36
132
37
-
You are of course free to modify the project to suit your needs. But the interesting bit starts at the `seaography::register_entity!` macro and the [seaography::Builder](https://docs.rs/seaography/1.1.0/seaography/builder/struct.Builder.html).
133
+
You are of course free to modify the project to suit your needs.
134
+
The interesting bit starts at the `seaography::register_entities!` macro in `query_root.rs`.
135
+
You can add custom entities, queries and mutations to the GraphQL schema.
136
+
137
+
## Run some queries
138
+
139
+
```sh
140
+
Visit GraphQL Playground at http://localhost:8000
141
+
```
142
+
143
+
Navigate to the GraphQL Playground, and then start running some queries!
0 commit comments