Skip to content

Conversation

@datapimp
Copy link

This is a minor enhancement to the filter configuration DSL that allows for developers to provide a brief human readable description of the filter / argument for the command.

class CreateBook < Mutations::Command
  required do
     desc "The Title of the book" 
     string :title
  end
end

In large projects which have a lot of commands, the ability to generate API documentation for those commands is very nice and the mutations gem already allows for a great level of introspection and so this is a natural extension of that.

Previously I solved this by adding the 'description' key to the filter options, but I like this approach as inline documentation becomes more of a first class citizen.

With this API in place you can inspect via: CreateBook.input_descriptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant