-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Separate input argument into module #4581
Separate input argument into module #4581
Conversation
Hi, thanks for the suggestion! Does this improve GraphQL-Ruby in some way, or is it a fix for a bug? Could you please help me understand the motivation for this change? |
This module will be used to improve the functionality. RelayClassicMutation has two functions: input argument and clientMutationId. I thought there might be cases where only the input argument functionality would be used, so I divided it into modules. The user can use def ExampleMutation < GraphQL::Schema::Mutation
include GraphQL::Schema::HasSingleInputArgument
...
end only the input argument functionality is available. |
…ate-input-argument-into-module # Conflicts: # lib/graphql/schema/relay_classic_mutation.rb
The conflict was resolved. The PR description has been rewritten with more detail. |
@@ -31,34 +35,14 @@ class RelayClassicMutation < GraphQL::Schema::Mutation | |||
def resolve_with_support(**inputs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior has not changed, although a slight modification has been made due to the effect of cutting out input-related processing.
Hi! Thanks for updating this and sorry I didn't write back sooner. I'm open to accepting this change except I'd rather keep the Here's an example test file with a small schema in it: https://github.com/rmosolgo/graphql-ruby/blob/f6da30f70007be9600783eb1ca054dc771533c8d/spec/graphql/schema/directive/transform_spec.rb#L3C1-L19C6 Do you mind updating this test that way? Then I think we'll be good to merge. |
Thanks for the review. Fixed test. |
Thanks for this improvement! |
Summary
There are two functions mixed in RelayClassicMutation, the input relation and the clientMutationId relation.
In our project, we want to use only the input relation, so it should be separated as a single module.
I researched this request and found the following Issue.
#3437
This Issue said "and I'd welcome a PR for either one." so I did it.
The reason it's Closed is because no one else was doing it at the time, not that the change itself is unacceptable, right?
Changes
The input-related functions were split into modules from the two functions of input and clientMutationId.
The behavior has not been changed.
Tested