2

I want to inherit common arguments from one input object type.

I tried below code but it didn't work anyone has other solution?

module TodoInputBase
  def self.included(input)
    argument :content, types.String
    argument :due_by, types.String
  end
end

TodoUpdateInput = GraphQL::InputObjectType.define do
  name "TodoUpdateInput"
  include TodoInputBase
end

TodoCreateInput = GraphQL::InputObjectType.define do
  name "TodoCreateInput"
  include TodoInputBase
  argument :author, !types.String
end`
Vimox Shah
  • 99
  • 1
  • 9

1 Answers1

0

This issue in Github may resolve your question: https://github.com/rmosolgo/graphql-ruby/issues/1412

Just inherit your input type from another input type.

Nadiya
  • 1,421
  • 4
  • 19
  • 34