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

Add a bunch more documentation (and rewrite README) #86

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

benjaminjkraft
Copy link
Collaborator

@benjaminjkraft benjaminjkraft commented Sep 9, 2021

Summary:

In this commit, I add a bunch more documentation of how to use
genqlient, including a getting started guide, and a FAQ that also acts
as a how-to shaped index of common configuration options and extension
points. Much of this is adapted from the internal doc I wrote at Khan,
or reorganized from what was in the README. Speaking of which, now that
there are better places for all the details, I rewrote the README to be
a bit more of an overview and index of other documentation. (For now I
left the "unmaintained" notes, which I'll remove fairly soon once all
our ducks are in a row.)

Fixes #26, #39.

Issue: #26
Issue: #39

Test plan:

make check, read the docs

@benjaminjkraft benjaminjkraft self-assigned this Sep 9, 2021
@benjaminjkraft benjaminjkraft force-pushed the benkraft.docs-2 branch 2 times, most recently from d74921e to 2ecc3ae Compare September 10, 2021 22:55
Base automatically changed from benkraft.docs-2 to main September 10, 2021 23:03
In this commit, I add a bunch more documentation of how to use
genqlient, including a getting started guide, and a FAQ that also acts
as a how-to shaped index of common configuration options and extension
points.  Much of this is adapted from the internal doc I wrote at Khan,
or reorganized from what was in the README.  Speaking of which, now that
there are better places for all the details, I rewrote the README to be
a bit more of an overview and index of other documentation.  (For now I
left the "unmaintained" notes, which I'll remove fairly soon once all
our ducks are in a row.)

Fixes #26.

Issue: #26

Test plan:
make check, read the docs

Reviewers: marksandstrom, adam, miguel, mahtab, jvoll
This is something that came up at Khan; we decided that just binding to
`int` is actually the right thing, but there are other options.

Fixes #39.
myGreatName: myField
}
```
and genqlient will generate a Go field `MyGreatName string`. Note that the alias will always be uppercased, to ensure the field is visible to the Go JSON library.
Copy link
Member

Choose a reason for hiding this comment

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

This is assuming that myField was already a string, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, yeah, I'll add some notes to that effect. Or maybe just call it myString!

# @genqlient(pointer: true)
arg: String,
) {
# @genqlient(pointer: true)
Copy link
Member

Choose a reason for hiding this comment

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

Can we also put # @genqlient(pointer: true) on the first line to apply it to everything in the query, similar to the previous omitempty example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! Will mention.

genqlient will generate the following types:

```go
type GetBooksFavoriteBook interface {
Copy link
Member

Choose a reason for hiding this comment

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

This might be documented elsewhere, but how does genqlient generate the FavouriteBook part of the name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep it's below! I can mention it.

docs/FAQ.md Outdated
```graphql
# This query gets the current user.
#
# @genqlient(...)
Copy link
Member

Choose a reason for hiding this comment

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

what is supposed to go inside @genqlient(...)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, this is just to show that if you have a genqlient directive, you can put it after the documentation. I'll clarify.

@benjaminjkraft benjaminjkraft merged commit 4d2058c into main Sep 14, 2021
@benjaminjkraft benjaminjkraft deleted the benkraft.docs-3 branch September 14, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document behavior/options for the 32-bit int issue Revamp documentation
2 participants