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

[FieldDefinitions] Support for Sorbet, heredoc descriptions, and shared resolver methods #77

Merged

Conversation

alex4787
Copy link
Contributor

A few extensions were added to the FieldDefinitions to adapt to some issues we encountered linting the codebase at Shopify, namely:

  • Support for Sorbet method signatures
  • Support for field definitions with heredoc descriptions
  • Support for when multiple fields share the same resolver method

I've amalgamated all the changes here as a work-in-progress PR, but before proceeding, I'd like to see if some/all of these are changes that you'd like to see in this gem. Once that's determined, I can break this down into more easily reviewable PRs and make appropriate updates.

@DmitryTsepelev
Copy link
Owner

Hi @alex4787, thanks for the proposal! I'm definitely open to any proposals since all cops are optional and users can easily turn off ones they don't like 🙂 Can't wait to merge this stuff in!

@alex4787 alex4787 force-pushed the field-definitions-update branch 5 times, most recently from 05aef4c to 811fca4 Compare March 22, 2022 17:49
@alex4787 alex4787 changed the title [FieldDefinitions] Various updates to FieldDefinitions (WIP) [FieldDefinitions] Various updates to FieldDefinitions Mar 22, 2022
@alex4787 alex4787 changed the title [FieldDefinitions] Various updates to FieldDefinitions [FieldDefinitions] Support for Sorbet, heredoc descriptions, and shared resolver methods Mar 22, 2022
@alex4787
Copy link
Contributor Author

alex4787 commented Mar 22, 2022

@DmitryTsepelev Code should be good to merge now, I've split it into three commits (per feature):

Let me know if there's anything I should fix, or if it'd be better for these to be split into their own PRs.

@alex4787 alex4787 force-pushed the field-definitions-update branch from 811fca4 to e95a00a Compare March 22, 2022 18:54
@@ -250,7 +438,6 @@ def last_name

expect_correction(<<~RUBY)
class UserType < BaseType

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some newline differences for autocorrection of FieldDefinitions because of how autocorrect is performed.

@DmitryTsepelev
Copy link
Owner

That's impressive, Thank you so much for the hard work! I'm going to merge it in and release the new version right now

@DmitryTsepelev DmitryTsepelev merged commit 4ba36a8 into DmitryTsepelev:master Mar 23, 2022
@alex4787
Copy link
Contributor Author

No problem! Thank you for being so open to these new additions and the quick responses, appreciate it! We'll be bumping our rubocop-graphql version very shortly for our codebase here 😄

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.

2 participants