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

Command doesn't work after upgrade #3169

Open
wzf1943 opened this issue Jul 2, 2024 · 1 comment
Open

Command doesn't work after upgrade #3169

wzf1943 opened this issue Jul 2, 2024 · 1 comment

Comments

@wzf1943
Copy link

wzf1943 commented Jul 2, 2024

What happened?

My project just did a library upgrade. The gqlgen's version upgrade from 0.13.0 -> 0.17.49, after upgrade I found some errors comes from graphql genrated.go. The error looks like this

../../graph/generated/generated.go:3734:2: not enough arguments in call to out.Dispatch
	have ()
	want (context.Context)

Then I tried to regenerate all related files. But the gqlgen give me this error

gqlgen.yml already exists
exit status 1

When I change the command from init to generate, there is new error
generating core failed: unable to load $SOMEPATH/graph/model - make sure you're using an import path to a package that exists
I'm not sure if I should update the path itself or something else?

What did you expect?

The tool can generate right go files for graphql

Minimal graphql.schema and models to reproduce

"The `Status` type, represent job execution status"
type Status {
  "Job running user"
  user: String!
.....
}

versions

  • go run github.com/99designs/gqlgen version? 0.17.49
  • go version? go1.22.4
@kashitaka
Copy link

kashitaka commented Aug 7, 2024

@wzf1943 Hi, I encountered the same errors and I came across this issue, but I resolved it, so I'll suggest the possible cause of the problem.

I think you might have a miss match of generator version and version of the package that your application depends on in go.mod.

While your application depends on 0.17.49 that expects out.Dispatch has ctx argument, your generator binary may be older version that generates out.Dispatch() instead of out.Dispatch(ctx).

So make sure you are using the same version of generator between go.mod and generator binary.

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

2 participants