99designs / 99designs/gqlgen

`init` doesn't work with `go run`

Offen
#2,334 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
10.8k
Forks
1.3k
Ø Merge
2 T. 36 Min.
Gemergte PRs (30 T.)
26

Beschreibung

### What happened?
I'm trying to use `go run` to execute `gqlgen init` as opposed to using a `tools.go` file, as I honestly prefer that approach, but receive the following error:

```shell
$ go run github.com/99designs/gqlgen@v0.17.14 init

go: downloading github.com/99designs/gqlgen v0.17.14
go: downloading github.com/vektah/gqlparser/v2 v2.4.8
Creating gqlgen.yml
Creating graph/schema.graphqls
Creating server.go
Generating...
reloading module info
modelgen: unable to find type: github.com/99designs/gqlgen/graphql.ID
exit status 1

```

It seems like `gqlgen` doesn't work with `go run`, which is confusing to me because I didn't think there is a big difference between that and `tools.go` besides just having to run `go mod tidy` and having the dependency graph of the project include the dependency being used.

### What did you expect?
I expected the command to work as if I was using a `tools.go` file and not throw an error

### Minimal graphql.schema and models to reproduce
You don't need anything besides a `go.mod` file in a folder

### versions
- `go run github.com/99designs/gqlgen version` v0.17.14
- `go version` 1.19? go version go1.19 darwin/arm64

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.