Share common arguments between query types in ruby graphql

542 Views Asked by At

What's the best way to share some arguments between different query types. I want to share some common arguments like created_at, updated_at

field :products, ProductType.connection_type, null: false do
  argument :name, [String], required: false
  # <--shared arguments args1-->
  # <--shared arguments args2-->
end
field :brands, BrandType.connection_type, null: false do
  argument :code, [String], required: false
  # <--shared arguments args1-->
end

We could use Resolver but it is not recommended unless absolutely necessary.

0

There are 0 best solutions below