Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Feature Request] Remove unmodified stubs with follow-schema #1314

Closed
duckbrain opened this issue Aug 28, 2020 · 3 comments
Closed

[Feature Request] Remove unmodified stubs with follow-schema #1314

duckbrain opened this issue Aug 28, 2020 · 3 comments
Labels

Comments

@duckbrain
Copy link
Contributor

duckbrain commented Aug 28, 2020

What happened?

When working with the layout: follow-schema option turned on, if I get over eager about running gqlgen, and add a new field name, gqlgen, rename it, and gqlgen again, I get stubs added for each name it has ever had added to the end of the file under the !!! WARNING !!! section.

It is a minor inconvenience to have to remove those resolver stubs manually.

What did you expect?

The unimplemented resolvers are detected as such and removed.

I'd think that the resolver generator checks for method bodies that contain panic("not implemented") or panic(fmt.Errorf("not implemented")) after trimming whitespace. (The first one is what and older version of the generator produced.) If the body contains only that string, it is ignored after it reads the source code and will be regenerated if it's still in the schema, and removed it it's not. That would have a side effect of "updating" the stubs using the old string.

versions

  • gqlgen version? v0.11.3
  • go version? go version go1.15 linux/amd64
  • dep or go modules? modules
@stale
Copy link

stale bot commented Nov 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 26, 2020
@frederikhors
Copy link
Collaborator

@duckbrain please tell me if this is still an issue with v0.16.0 and I'll re-open it.

@duckbrain duckbrain changed the title follow-schema leaves resolver stubs Feature Request Remove unmodified stubs with follow-schema Feb 5, 2022
@duckbrain duckbrain changed the title Feature Request Remove unmodified stubs with follow-schema [Feature Request] Remove unmodified stubs with follow-schema Feb 5, 2022
@duckbrain
Copy link
Contributor Author

This isn't implemented. It is just a convenience feature when prototyping and designing the API.

@frederikhors frederikhors converted this issue into discussion #1947 Feb 5, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants