I am new to GraphQL, gqlgen library. Tried running go run github.com/99designs/gqlgen init
command but getting validation failed: packages.Load: C:\Users\Aylin\Desktop\gqlgen-tutorial\graph\prelude.resolvers.go:19:44: __DirectiveResolver not exported by package generated
error. This is the first step of the project setup and is not supposed to cause any errors. Anyone had the same problem and knows how to fix it? Thanks
gqlgen - DirectiveResolver not exported by package generated
I took this one and I've resolved it. Change version for "github.com/vektah/gqlparser/v2" in your go.mod file. From:
go 1.16
require (
github.com/99designs/gqlgen v0.13.0
github.com/vektah/gqlparser/v2 v2.2.0
)
To:
github.com/vektah/gqlparser/v2 v2.1.0
Delete prelude.resolvers.go after that.
Worked for me, thanks! Any idea about why this happens in the first place, or when they're going to fix this? –
Chow
© 2022 - 2024 — McMap. All rights reserved.
schema: - schema.graphql exec: filename: ../../src/http_app/gql/generated/generated.go package: generated model: filename: ../../src/model/models_gen.go package: model resolver: layout: follow-schema dir: ../../src/http_app/gql package: gql filename_template: "{name}.resolvers.go" type: Resolver autobind: - framegork/src/model omit_slice_element_pointers: true
– Furthermore