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

int64 becoming int in models #2580

Closed
wedobetter opened this issue Mar 8, 2023 · 3 comments
Closed

int64 becoming int in models #2580

wedobetter opened this issue Mar 8, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@wedobetter
Copy link

wedobetter commented Mar 8, 2023

What happened?

I have defined my models in gqlgen.yaml, everything gets imported fine but I have noticed an automatic conversion in the models struct:

int64 becomes int
[]int64 becomes []int

What did you expect?

Models imported as defined

Minimal graphql.schema and models to reproduce

type DeleteRequest struct {
	Numbers []int64 `json:"ids,omitempty"`
}

becomes

type DeleteRequest struct {
        Numbers []int `json:"ids"`
}

versions

gqlgen: v0.17.26
go: 1.20.1 darwin/arm64

Thanks

@wedobetter wedobetter changed the title int64 int64 becoming int in models Mar 8, 2023
@StevenACoffman
Copy link
Collaborator

Hmmm... this definitely seems like a mistake. int is a signed integer type that is at least 32 bits in size. It is a distinct type, however, and not an alias for, say, int32. PR would be welcome.

@StevenACoffman
Copy link
Collaborator

StevenACoffman commented Mar 20, 2023

Hey, I think I have reverted the problematic PRs. @wedobetter I don't know if you are able to try out the latest commit, but I would appreciate you verifying that it solves your issue.

@StevenACoffman
Copy link
Collaborator

I released v0.17.27 which I believe resolves this issue. Please reopen if it does not. Thanks and sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants