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

fix #2465 remote model with omitempty #2468

Merged
merged 1 commit into from
Dec 14, 2022
Merged

fix #2465 remote model with omitempty #2468

merged 1 commit into from
Dec 14, 2022

Conversation

mstephano
Copy link
Contributor

@mstephano mstephano commented Dec 14, 2022

Fixes #2465

Running go generate creates unnecessary resolvers when:

  1. using a remote model that has a json tag with omitempty, and the value of json is different than the attribute name
  2. the remote package is in autobind in gqlgen.yml file, and also struct_tag: json is used
  3. these new resolvers need to be implemented but my expected result is to be able to use my model right away

The reason I am having this error is because I am adding gqlgen to an existing repo with many models. I want these models to stay in the files they are right now, not having them "duplicated" under /graph/model.

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

Here is a video demonstrating my integration test:

Screen.Recording.2022-12-13.at.11.53.37.PM.mov

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 75.672% when pulling c57921a on mstephano:master into da43147 on 99designs:master.

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

Successfully merging this pull request may close these issues.

Unnecessary resolver is created when json tag has omitempty and value different than property name
3 participants