Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to describe input filters #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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