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

Error: cannot use config.PackageConfig{...} (type config.PackageConfig) as type config.ExecConfig in field value #92

Closed
diep-it-dn opened this issue Jan 24, 2022 · 6 comments

Comments

@diep-it-dn
Copy link

This error occured in the latest version: v0.0.2:
../../../../go/pkg/mod/github.com/!yamashou/gqlgenc@v0.0.2/config/config.go:203:3: cannot use config.PackageConfig{...} (type config.PackageConfig) as type config.ExecConfig in field value

@droslean
Copy link

Same here.

@Yamashou
Copy link
Owner

please try v0.0.3! if get same error, tell me it

@diep-it-dn
Copy link
Author

Hi @Yamashou, I've tried v0.0.3 and get this error:

`go run github.com/Yamashou/gqlgenc
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x1029c4b0c]

goroutine 1 [running]:
github.com/Yamashou/gqlgenc/clientgen.RenderTemplate(0x140000fc900, 0x140009832c0, 0x140009835c0, {0x102e79678, 0x0, 0x0}, {0x140006d3b00, 0x22, 0x22}, {0x1400067e240, ...}, ...)`

This version v0.0.2-gql is working for me. Hope you can see the issue in v0.0.3!
Thanks for your update!

@ahobsonsayers
Copy link
Contributor

ahobsonsayers commented Feb 24, 2022

I also get the following error on v0.0.3, same as @diep-it-dn

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x83e193]

goroutine 1 [running]:
github.com/Yamashou/gqlgenc/clientgen.RenderTemplate(0xc0000dc900, 0xc00084f1a0, 0xc00084f340, {0xd07b78, 0x0, 0x0}, {0xc000011818, 0x1, 0x1}, {0xc0000117f0, ...}, ...)
        /home/arranhs/go/pkg/mod/github.com/!yamashou/gqlgenc@v0.0.3/clientgen/template.go:22 +0x313
github.com/Yamashou/gqlgenc/clientgen.(*Plugin).MutateConfig(0xc00007ebc0, 0xc0000dc900)
        /home/arranhs/go/pkg/mod/github.com/!yamashou/gqlgenc@v0.0.3/clientgen/client.go:80 +0x5f9
github.com/Yamashou/gqlgenc/generator.Generate({0x9cddb0, 0xc0000240b8}, 0xc0000c8630, {0xc0000e7f28, 0x1, 0x6})
        /home/arranhs/go/pkg/mod/github.com/!yamashou/gqlgenc@v0.0.3/generator/generater.go:52 +0x2e5
main.main()
        /home/arranhs/go/pkg/mod/github.com/!yamashou/gqlgenc@v0.0.3/main.go:30 +0x3ab

v0.0.2 is giving me the same error as in the OP

../../../go/pkg/mod/github.com/!yamashou/gqlgenc@v0.0.2/config/config.go:203:3: cannot use config.PackageConfig{...} (type config.PackageConfig) as type config.ExecConfig in field value

Currently using v0.0.2-update i.e. github.com/Yamashou/gqlgenc@v0.0.2-update and it seems to work great. Haven't tried v0.0.2-gql as v0.0.2-update looked to be more recent.

Thanks for the help!

@mkazutaka
Copy link

mkazutaka commented Mar 9, 2022

I also faced same error on v0.0.3

the error cause the my .gqlgenc.yaml doesn't have generate key. as a result, generateCfg is nil and cause that.

"ClientInterfaceName": generateCfg.ClientInterfaceName,

I fixed that to add following to my .gqlgenc.yaml

generate:
  suffix:
  prefix:

@Yamashou
Copy link
Owner

Yamashou commented Mar 9, 2022

@diep-it-dn
So later,
I now push new latest version. please try this latest version 🙏

And if you can do v2 client, please change v2 client. (watch an example)

@Yamashou Yamashou closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants