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

Generate getters for interface fields #2314

Merged
merged 7 commits into from
Aug 5, 2022
Merged

Generate getters for interface fields #2314

merged 7 commits into from
Aug 5, 2022

Conversation

neptoess
Copy link
Contributor

@neptoess neptoess commented Aug 4, 2022

Closes #1469
The Star Wars example has a small hack in it (GetFriendsConnection / GetFriends) due to the custom resolver logic. That may need looked at, since it's no longer a very clear cut example

@neptoess
Copy link
Contributor Author

neptoess commented Aug 5, 2022

I see a lot of the checks failing. Didn’t realize quite how many tests there were throughout the codebase. Are any safe to ignore, or should I go into each and make sure they all pass?

@giautm
Copy link
Contributor

giautm commented Aug 5, 2022

I see a lot of the checks failing. Didn’t realize quite how many tests there were throughout the codebase. Are any safe to ignore, or should I go into each and make sure they all pass?

There is some issue with the template, you need to fix all issues.

template.gotpl: template: template.gotpl:39:17: executing "template.gotpl" at <.Interfaces>: error calling Interfaces: not found

@neptoess
Copy link
Contributor Author

neptoess commented Aug 5, 2022

The lint step is failing because of a generated code diff. No matter how I try to run go generate locally, including running ./.github/workflows/check-generate directly in my local bash, I can't seem to generate anything different. Not sure how to fix this one.

EDIT: In case it's relevant, running Windows 10 64-bit, Go 1.19
EDIT 2: Workflow results https://github.com/neptoess/gqlgen/runs/7695262937?check_suite_focus=true#step:6:27
EDIT 3: Passing now. There must be some small differences in whitespace behavior with text/template introduced in 1.19, so I just manually popped in the offending whitespace

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 74.801% when pulling 0a2f820 on neptoess:add-interface-getters into 0d91c89 on 99designs:master.

@StevenACoffman
Copy link
Collaborator

So the generated code comment has either one or two leading spaces depending on Go 1.18 vs Go 1.19:

//  These things are all valid, but without care generate invalid go code

Which originates from the GraphQL schema comment:

""" These things are all valid, but without care generate invalid go code """

Not sure what is different, but that's probably a separate issue from this PR, so it's ok to have manually fudged it here.

@StevenACoffman
Copy link
Collaborator

Please see #2331

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.

Generate Getters for Interface Fields
4 participants