-
We're currently on 1.13.10 and preparing for the big 2+ upgrade. In our tests, we habitually send (Was it required in order to instantiate the Singleton? Certainly
I'm wondering what the approved method would be for achieving this aim? Or are we doing things completely wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yep, this isn't the first time I've heard of it! (Even the graphql-ruby tests did it.) In short, when a legacy Input Object definition was created, it also created a custom Inside Here are couple examples from the graphql-ruby tests for how to migrate this code: graphql-ruby/spec/graphql/schema/input_object_spec.rb Lines 627 to 638 in 2b35a5d In short, pass |
Beta Was this translation helpful? Give feedback.
Yep, this isn't the first time I've heard of it! (Even the graphql-ruby tests did it.) In short, when a legacy Input Object definition was created, it also created a custom
GraphQL::Query::Arguments
subclass which contained some behavior pertaining to the input object's specific arguments.Inside
InputObject#initialize
, it would do different kinds of initialization given different inputs. Legacy-style inputs would still work if the custom Arguments subclass was also present. So probably, when migrating from.define
-based definitions to class-based definitions, adding.to_graphql
(which, under the hood, prepared that specialized Arguments subclass) made the previous initia…