Clean up example a little (#89)
## Summary: I realized: - it's simpler to avoid the usual `cmd` and just put it all in the same directory - we don't need schema.json since GitHub now posts a schema in SDL format ## Test plan: make lint example Author: benjaminjkraft Reviewers: dnerdy, StevenACoffman, aberkan, jvoll, mahtabsabet, MiguelCastillo Required Reviewers: Approved By: dnerdy, StevenACoffman Checks: ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint, ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Lint Pull Request URL: https://github.com/Khan/genqlient/pull/89
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ Create a [personal access token](https://docs.github.com/en/github/authenticatin
|
||||
To run the example:
|
||||
|
||||
```sh
|
||||
$ GITHUB_TOKEN=<your token> go run ./cmd/example/main.go <username>
|
||||
$ GITHUB_TOKEN=<your token> go run . <username>
|
||||
you are Ben Kraft
|
||||
csilvers is Craig Silverstein
|
||||
```
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/Khan/genqlient/example"
|
||||
)
|
||||
|
||||
func main() {
|
||||
example.Main()
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package example
|
||||
package main
|
||||
|
||||
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# These are the defaults, and are just included to be explicit.
|
||||
package: example
|
||||
schema: schema.graphql
|
||||
operations:
|
||||
- genqlient.graphql
|
||||
generated: generated.go
|
||||
|
||||
# needed since it doesn't match the directory name:
|
||||
package: main
|
||||
|
||||
# We bind github's DateTime scalar type to Go's time.Time (which conveniently
|
||||
# already defines MarshalJSON and UnmarshalJSON). This means genqlient will
|
||||
# use time.Time when a query requests a DateTime, and is required for custom
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package example
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -19,7 +19,7 @@ func (t *authedTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
return t.wrapped.RoundTrip(req)
|
||||
}
|
||||
|
||||
func Main() {
|
||||
func main() {
|
||||
var err error
|
||||
defer func() {
|
||||
if err != nil {
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user