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

Document the "dsl" module/language #82

Closed
Cito opened this issue May 15, 2020 · 5 comments
Closed

Document the "dsl" module/language #82

Cito opened this issue May 15, 2020 · 5 comments
Assignees
Labels
type: documentation An issue or pull request for improving or updating the documentation type: question or discussion Issue discussing or asking a question about gql
Milestone

Comments

@Cito
Copy link
Member

Cito commented May 15, 2020

The somewhat obscure "dsl" module/language included in gql should be documented. It is currently unclear to me where it is coming from, whether it mimics an existing thing or was an invention of @syrusakbary. Does anybody know?

Note: I'm not talking about the "schema definition language" of GraphQL here, but about the dsl module in gql. I think the name "dsl" is also a bit misleading because it usually means "domain specific language", but this is actually a general purpose language and not domain specific in the usual sense of "application domain specific". As far as I understand it is just an alternative way to express GraphQL documents in Python instead of JSON, Similar to the "SQL Expression language" in SQLAlchemy which allows writing SQL queries in Python.

@Cito Cito added this to the Version 3 milestone May 15, 2020
@Cito Cito added discussion type: documentation An issue or pull request for improving or updating the documentation type: question or discussion Issue discussing or asking a question about gql labels May 15, 2020
@Cito
Copy link
Member Author

Cito commented May 15, 2020

Btw, there is also an "improved-dsl" feature branch that has not yet been merged if anybody wants to look into this.

@KingDarBoja KingDarBoja self-assigned this Jun 29, 2020
@leszekhanusz
Copy link
Collaborator

FYI I added a very small example of the dsl module in the readme in PR #114

@leszekhanusz
Copy link
Collaborator

Note: I have completely refactored the DSL code in PR #169
It is a breaking change but:

  • it should integrate correctly with the rest of the current code (with sessions)
  • it supports subscriptions
  • and it comes with full documentation 🎉

I've looked into the improved-dsl branch and it sounds quite obsolete except maybe for the
"Add alias to selection as keyword argument" commit which could be a good idea to simplify the aliases?

@KingDarBoja
Copy link
Contributor

"Add alias to selection as keyword argument" commit which could be a good idea to simplify the aliases?

I am up for that change as well, maybe on same branch as refactored DSL 🤔

leszekhanusz added a commit that referenced this issue Nov 21, 2020
Refactoring of the DSL code.

The DSLSchema only needs a schema, a Client is no more needed.
New dsl_gql function to convert the DSL operations into a Document
This allows DSL queries to be executed in a session instead of a client (Solves #138)
Added typing annotations
Added code documentation and sphinx docs (Solves #82)
Supports Subscriptions
Fix nested input arguments
Allow to set the alias directly in the select method
Allow multiple operations in a document
Allow to set the operation name
@leszekhanusz
Copy link
Collaborator

Fixed in v3.0.0a5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating the documentation type: question or discussion Issue discussing or asking a question about gql
Projects
None yet
Development

No branches or pull requests

3 participants