Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add seaography documentation #41

Merged
merged 14 commits into from
Sep 12, 2022
Merged

Conversation

karatakis
Copy link
Contributor

PR Info

Adds documentation for the new project of the SeaQL family Seaography.
Seaography is a CLI tool that generates a ready to compile Rust GraphQL API for a relational database.

The initial draft can be found here: SeaQL/summer-of-code#12

@netlify
Copy link

netlify bot commented Jul 19, 2022

Deploy Preview for seaql ready!

Name Link
🔨 Latest commit 4578115
🔍 Latest deploy log https://app.netlify.com/sites/seaql/deploys/631ca75a65363a0008de2061
😎 Deploy Preview https://deploy-preview-41--seaql.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tyt2y3
Copy link
Member

tyt2y3 commented Jul 24, 2022

Also, why doesn't this link work? https://deploy-preview-41--seaql.netlify.app/Seaography

It seems like docusaurus is not correctly set up?


* Recommended to study, but not required

## How to use
Copy link
Member

@tyt2y3 tyt2y3 Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hoping to see a more comprehensive step by step guide, from the sample database to running GraphQL queries, perhaps with a few screenshots along the way if that help illustrate. Actually, if you have the energy, a short video screencast would be perfect! (It's not necessary though)

But yeah at least you get the idea, something like:

  1. Install the prerequisites
  2. Load the sample database
  3. Run the codegen
  4. Compile the Rust project
  5. Make GraphQL queries!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point.

I will create a page "How to run the example database" and document the step by step process using pictures.

Regarding the video I will take a note of it and work on it on the future.

let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription)
.data(database)
.data(orm_dataloader)
.limit_complexity(5)
Copy link
Member

@tyt2y3 tyt2y3 Jul 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we always want to limit the complexity in practice. So I think the codegen should always generate this clause. And actually we can allow the user to config this number via the cli parameter.

5 sounds like a reasonable default!

This chapter can still discuss this topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add it and be CLI driven

@tyt2y3
Copy link
Member

tyt2y3 commented Jul 24, 2022

Also, I think we need one chapter discussing scaler filter and pagination, with a GraphQL input and a SQL output (sounds a lot like the test suite?)

And another chapter for relational query. We should first select 2 or 3 tables with relation from the sample database and make several GraphQL queries against them.

@tyt2y3
Copy link
Member

tyt2y3 commented Jul 24, 2022

Finally, I think we need a chapter for some hints to how to customize the query mechanism and/or extend the GraphQL schema.

I think we can also give a gentle introduction of GraphQL, how GraphQL resolvers work and perhaps comparison with other related GraphQL frameworks / engine.

@karatakis
Copy link
Contributor Author

Also, why doesn't this link work? https://deploy-preview-41--seaql.netlify.app/Seaography

It seems like docusaurus is not correctly set up?

Because the netlify build command is not configured correct

The current build command:
https://app.netlify.com/sites/seaql/deploys/62dd5353b844490009d00f68#L64

How to fix it:

@billy1624
Copy link
Member

Hey @karatakis, I just make Netlify and GitHub Action to build docs using build.sh script.

You can add seaography build script into build.sh once and make seaography built in development and production environment. Please merge master into current PR.
Thanks!! :D

@karatakis
Copy link
Contributor Author

Also, I think we need one chapter discussing scaler filter and pagination, with a GraphQL input and a SQL output (sounds a lot like the test suite?)

And another chapter for relational query. We should first select 2 or 3 tables with relation from the sample database and make several GraphQL queries against them.

I will try to give some details in the example page

@karatakis
Copy link
Contributor Author

karatakis commented Jul 25, 2022

Finally, I think we need a chapter for some hints to how to customize the query mechanism and/or extend the GraphQL schema.

I think we can also give a gentle introduction of GraphQL, how GraphQL resolvers work and perhaps comparison with other related GraphQL frameworks / engine.

The "encancements-cookbook" is meant to be a chapter to explain how to extend the generated code. I will look to rename it and add more documentation on how to extend.

Regarding the comparison between other GraphQL frameworks we cannot compare because we depend on async_graphql and it already has a comparison page here https://github.com/async-graphql/async-graphql/blob/master/feature-comparison.md Moreover we provide something else, we generate a GraphQL API, they provide GraphQL framework.

* [X] index page
* [ ] tool internals page
* [ ] generated project structure page
* [ ] enchantments cookbok page
    * [X] index page
    * [X] tool internals page
    * [ ] generated project structure page
    * [ ] enchantments cookbok page
* fix links at index page
        * [X] index page
        * [X] tool internals page
        * [X] generated project structure page
        * [ ] real example page
        * [ ] enchantments cookbok page
* remove real world example page
            * add example graphql schema
            * [X] index page
            * [X] tool internals page
            * [X] generated project structure page
            * [X] enchantments cookbok page
* add Seaography on build.sh
* update index page, and getting started page
* rename cookbook to extending code
* add running example page

## Query examples

### Fetch albums where artist ID = 1 || ID = 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I really liked these. This is where everything comes to live!


Extra iterator adaptors, functions and macros.

* Recommended to study, but not required
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The * makes this line being interpreted as a list. Consider escaping it :)

Suggested change
* Recommended to study, but not required
\* Recommended to study, but not required

@tyt2y3
Copy link
Member

tyt2y3 commented Aug 8, 2022

@karatakis Let me know when you want to publish an initial version of this

@tyt2y3
Copy link
Member

tyt2y3 commented Sep 7, 2022

@billy1624 how do we syntax highlight Rust?

image

@tyt2y3 tyt2y3 changed the base branch from master to seaography September 12, 2022 15:04
@tyt2y3 tyt2y3 marked this pull request as ready for review September 12, 2022 15:04
@tyt2y3 tyt2y3 merged commit 8555658 into SeaQL:seaography Sep 12, 2022
@tyt2y3
Copy link
Member

tyt2y3 commented Sep 12, 2022

Merged to the seaography branch. Billy & I will make some edits.

@tyt2y3 tyt2y3 mentioned this pull request Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Make it public?
3 participants