-
Hi, given the mutation
it used to create a type for the input named: Is there a why to restore the old behavior or is it possible to explicitly define the name of the mutation input class? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! Sorry to hear that it stopped working. There were some changes to how mutations generate their input types, for example: v1.12.21...v1.13.0#diff-74f77a993e7facb851ef0be965716bac540dfe856aae65dff2f0c755ae26f1f0R86 I would expect that graphql-ruby/lib/graphql/schema/relay_classic_mutation.rb Lines 144 to 147 in 8bf6364 So, I'd expect something like this to work: class Mutations::BaseMutation < GraphQL::Schema::RelayClassicMutation
def self.default_graphql_name
# remove leading `Mutation` and any `::` from class name
@default_graphql_name ||= name.sub(/^Mutation/, "").gsub("::", "")
end
end Then, the code above would add Does that work for you? Or do you have any similar code in your application that used to work, but doesn't work anymore? (If so, could you please share it? Maybe I've broken something 🙈 !) |
Beta Was this translation helpful? Give feedback.
Hi! Sorry to hear that it stopped working.
There were some changes to how mutations generate their input types, for example: v1.12.21...v1.13.0#diff-74f77a993e7facb851ef0be965716bac540dfe856aae65dff2f0c755ae26f1f0R86
I would expect that
def self.default_graphql_name
in the mutation class be in charge of this, based on this code:graphql-ruby/lib/graphql/schema/relay_classic_mutation.rb
Lines 144 to 147 in 8bf6364
So, I'd expect something like this to work: