Skip to content

Requiring one of 2 Arguments to be required  #2267

@RobsonKing

Description

@RobsonKing

I have a field that I want to filter in one of two ways.

    field :car, Types::CarType, null: false do
      argument :id, ID, required: true
      argument :external_id, ID, required: false
    end

Is there anyway to indicate that one of the two values must be required, but not both?

I tried overriding GraphQL::Schema::Argument, but it doesn't seem like 'context' is available where 'required' is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions