Add a cop to enforce prepare argument as a Symbol or String #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been working a lot with Sorbet and introduced better support for GraphQL Prepare Methods including adding support for the
prepare
method to be defined on the current classUsing the upstream example for graphql-ruby
This cop isn't enabled by default because I don't think everyone wants this, but we've found that removing lambdas makes our codebase much more effective to test, and easier to read, and the combination of sorbet/tapioca makes it even more effective to write & maintain code.
This cop by default will raise offenses when a block argument is provided, and request that a string or symbol is provided. but can be configured to require a string XOR symbol based on
EnforcedStyle