Sha256: a79939b29401235e398992ffee90b83f24bf8882989033bb98f340184190188c

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

GraphQL::SkipDirective = GraphQL::Directive.new do |d|
  d.name "skip"
  d.description "Ignore this part of the query if `if` is true"
  d.on([GraphQL::Directive::ON_FIELD, GraphQL::Directive::ON_FRAGMENT])
  d.arguments({
    if: d.arg({type: !GraphQL::BOOLEAN_TYPE})
  })
  d.resolve -> (arguments, proc) {
    if !arguments["if"]
      proc.call
    else
      nil
    end
  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graphql-0.1.0 lib/graph_ql/directives/skip_directive.rb