I was following this tutorial https://www.howtographql.com/graphql-go/1-getting-started/ and had a hard time getting it to work.
First, i tried all this in a subfolder of my Documents
folder. However, after step
go run github.com/99designs/gqlgen init
only the schema was created.
However, if i execute the same steps in, e.g. a subfolder of Deskotp
, everything gets created correctly.
Should be structure:
.
├── go.mod
├── go.sum
├── gqlgen.yml
├── graph
│ ├── generated
│ │ └── generated.go
│ ├── model
│ │ └── models_gen.go
│ ├── resolver.go
│ ├── schema.graphqls
│ └── schema.resolvers.go
└── server.go
3 directories, 9 files
Structure if executed in sub folder of Documents
:
.
├── go.mod
├── go.sum
└── graph
└── schema.graphqls
1 directory, 3 files
Operating system: macOS Big Sur, 11.6 (MacBook Pro (16-inch, 2019)) Go version: go version go1.17.4 darwin/amd64
Can anyone help me out on why this does not work in the Documents
sub tree?
Thanks a lot.
edit: As suggested go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ferdinand/Library/Caches/go-build"
GOENV="/Users/ferdinand/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/ferdinand/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/ferdinand/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ferdinand/Documents/ownSoftwareProjects/gqlgen-tools/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/11/hy4ct0x12hq7yxppy9cbq7pm0000gn/T/go-build4186097959=/tmp/go-build -gno-record-gcc-switches -fno-common"