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

fix misspelling and format code #2497

Merged
merged 3 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ This reverts commits 64b882c3c9901f25edc0684ce2a1f9b63443416b and 670cf22272b490

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/5f5bfcb97fdb01026cf35a5dc46f1246a30f9b26"><tt>5f5bfcb9</tt></a> fix <a href="https://github.com/99designs/gqlgen/pull/2204">#2204</a> - don't try to embed builtin sources (<a href="https://github.com/99designs/gqlgen/pull/2214">#2214</a>)</summary>

* dont't try to embed builtins
* don't try to embed builtins

* add test

Expand Down Expand Up @@ -3068,7 +3068,7 @@ Remove stale bot

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/34a442c7980f5ba363f58aaee67b9ddaa77d7520"><tt>34a442c7</tt></a> Merge pull request <a href="https://github.com/99designs/gqlgen/pull/1399">#1399</a> from 99designs/prevent-possible-error-deadlock</summary>

Dont hold error lock when calling into error presenters
Don't hold error lock when calling into error presenters

</details></dd></dl>

Expand Down Expand Up @@ -6353,7 +6353,7 @@ duration of inactivity.

- <a href="https://github.com/99designs/gqlgen/commit/693753fcc69329fba282ad5f1d69c02979cbce08"><tt>693753fc</tt></a> Add websocket keepalive support

- <a href="https://github.com/99designs/gqlgen/commit/162afad73b653d9456d21ec38d00c3476ab2dde4"><tt>162afad7</tt></a> enums dont exist in runtime
- <a href="https://github.com/99designs/gqlgen/commit/162afad73b653d9456d21ec38d00c3476ab2dde4"><tt>162afad7</tt></a> enums don't exist in runtime

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/d0b6485b23f259588e9ecd34e23924c741d9c6f2"><tt>d0b6485b</tt></a> Merge pull request <a href="https://github.com/99designs/gqlgen/pull/525">#525</a> from 99designs/stop-grc-panic</summary>

Expand Down Expand Up @@ -8322,7 +8322,7 @@ Validate at end

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/b16e84295a1e72d27c6b96784c0266058d8716bb"><tt>b16e8429</tt></a> Merge pull request <a href="https://github.com/99designs/gqlgen/pull/159">#159</a> from vektah/enum-only-generation</summary>

Dont skip model generation if there are enums defined
Don't skip model generation if there are enums defined

</details></dd></dl>

Expand Down
3 changes: 1 addition & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ npm install

will write the schema to `integration/schema-fetched.graphql`, compare that with `schema-expected.graphql`

CI will run this and fail the build if the two files dont match.

CI will run this and fail the build if the two files don't match.
2 changes: 1 addition & 1 deletion _examples/todo/todo.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func New() Config {
}

if ownable.Owner().ID != getUserId(ctx) {
return nil, fmt.Errorf("you dont own that")
return nil, fmt.Errorf("you don't own that")
}
}

Expand Down
4 changes: 2 additions & 2 deletions _examples/todo/todo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestTodo(t *testing.T) {
}
}
err := c.Post(`mutation { updateTodo(id: 3, changes:{done:true}) { text, done } }`, &resp)
require.EqualError(t, err, "[{\"message\":\"you dont own that\",\"path\":[\"updateTodo\",\"done\"]}]")
require.EqualError(t, err, "[{\"message\":\"you don't own that\",\"path\":[\"updateTodo\",\"done\"]}]")

require.Nil(t, resp.UpdateTodo)
})
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestTodo(t *testing.T) {
}
err := c.Post(`{ todo(id:3) { text, done } }`, &resp)

require.EqualError(t, err, `[{"message":"you dont own that","path":["todo","done"]}]`)
require.EqualError(t, err, `[{"message":"you don't own that","path":["todo","done"]}]`)
require.Nil(t, resp.Todo)
})

Expand Down
4 changes: 2 additions & 2 deletions codegen/templates/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s *Imports) Reserve(path string, aliases ...string) (string, error) {
panic("empty ambient import")
}

// if we are referencing our own package we dont need an import
// if we are referencing our own package we don't need an import
if code.ImportPathForDir(s.destDir) == path {
return "", nil
}
Expand Down Expand Up @@ -85,7 +85,7 @@ func (s *Imports) Lookup(path string) string {

path = code.NormalizeVendor(path)

// if we are referencing our own package we dont need an import
// if we are referencing our own package we don't need an import
if code.ImportPathForDir(s.destDir) == path {
return ""
}
Expand Down
8 changes: 4 additions & 4 deletions docs/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ Returning to `graph/schema.resolvers.go`, let's implement the bodies of those au

```go
func (r *mutationResolver) CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error) {
rand, _ := rand.Int(rand.Reader, big.NewInt(100))
rand, _ := rand.Int(rand.Reader, big.NewInt(100))
todo := &model.Todo{
Text: input.Text,
ID: fmt.Sprintf("T%d", rand),
Text: input.Text,
ID: fmt.Sprintf("T%d", rand),
User: &model.User{ID: input.UserID, Name: "user " + input.UserID},
}
r.todos = append(r.todos, todo)
Expand Down Expand Up @@ -190,7 +190,7 @@ query findTodos {

### Don't eagerly fetch the user

This example is great, but in the real world fetching most objects is expensive. We dont want to load the User on the
This example is great, but in the real world fetching most objects is expensive. We don't want to load the User on the
todo unless the user actually asked for it. So lets replace the generated `Todo` model with something slightly more
realistic.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/recipes/migration-0.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Many of the old interfaces collapse down into just a few extension points:

![Anatomy of a request](/request_anatomy.png)

The tracing interface has also been removed, tracing stats are now measured in core (eg time to parse query) and made available on the operation/response contexts. Much of the old interface was designed so that users of a tracer dont need to know which extension points it was listening to, the new handler extensions have the same goal.
The tracing interface has also been removed, tracing stats are now measured in core (eg time to parse query) and made available on the operation/response contexts. Much of the old interface was designed so that users of a tracer don't need to know which extension points it was listening to, the new handler extensions have the same goal.

### Backward compatibility

Expand Down
4 changes: 2 additions & 2 deletions graphql/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Stats struct {
Parsing TraceTiming
Validation TraceTiming

// Stats collected by handler extensions. Dont use directly, the extension should provide a type safe way to
// Stats collected by handler extensions. Don't use directly, the extension should provide a type safe way to
// access this.
extension map[string]interface{}
}
Expand All @@ -26,7 +26,7 @@ var ctxTraceStart key = "trace_start"

// StartOperationTrace captures the current time and stores it in context. This will eventually be added to request
// context but we want to grab it as soon as possible. For transports that can only handle a single graphql query
// per http requests you dont need to call this at all, the server will do it for you. For transports that handle
// per http requests you don't need to call this at all, the server will do it for you. For transports that handle
// multiple (eg batching, subscriptions) this should be called before decoding each request.
func StartOperationTrace(ctx context.Context) context.Context {
return context.WithValue(ctx, ctxTraceStart, Now())
Expand Down
2 changes: 1 addition & 1 deletion handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func ErrorPresenter(f graphql.ErrorPresenterFunc) Option {
}
}

// IntrospectionEnabled = false will forbid clients from calling introspection endpoints. Can be useful in prod when you dont
// IntrospectionEnabled = false will forbid clients from calling introspection endpoints. Can be useful in prod when you don't
// want clients introspecting the full schema.
// Deprecated: switch to graphql/handler.New
func IntrospectionEnabled(enabled bool) Option {
Expand Down
2 changes: 1 addition & 1 deletion internal/code/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (p *Packages) NameForPackage(importPath string) string {
pkg := p.packages[importPath]

if pkg == nil {
// otherwise do a name only lookup for it but dont put it in the package cache.
// otherwise do a name only lookup for it but don't put it in the package cache.
p.numNameCalls++
pkgs, err := packages.Load(&packages.Config{Mode: packages.NeedName}, importPath)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import (
"os"
"path/filepath"

"github.com/urfave/cli/v2"

"github.com/99designs/gqlgen/api"
"github.com/99designs/gqlgen/codegen/config"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/internal/code"
"github.com/99designs/gqlgen/plugin/servergen"
"github.com/urfave/cli/v2"
)

//go:embed init-templates/schema.graphqls
Expand Down