99designs / gqlgen

go generate based graphql server library
https://gqlgen.com
MIT License
9.94k stars 1.17k forks source link

i have n number of graphql file and i want separate resolver of each graphql file . how it is possible #987

Closed tyagip966 closed 4 years ago

tyagip966 commented 4 years ago

i have n number of graphql file and i want separate resolver of each graphql file . how it is possible

I want to create sperate resolver for each .graphql file.

Out put of go env : GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/krawler/.cache/go-build" GOENV="/home/krawler/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/krawler/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/krawler/go/src/demo/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build655509784=/tmp/go-build -gno-record-gcc-switches"

hellowin commented 4 years ago

i have n number of graphql file and i want separate resolver of each graphql file . how it is possible

I want to create sperate resolver for each .graphql file.

Can you elaborate more with your *.graphql and your gqlgen.yml?

ihgann commented 4 years ago

The default behavior is to replicate the topology from the query/mutation state. In this way, you will already get a unique resolver per query/mutation type.

Are you talking about multiple, independent schemas? If so, multiple gqlgen.yml files might be a solution (one for each schema).

vektah commented 4 years ago

with gqlgen 0.11 and resolver.layout: follow-schema resolvers will be generated based on the schema files. see https://gqlgen.com/master/config/

image