Sha256: 02b29ed60c343b142faa5272e3aed23a5c60f0102846a7fa2293952a4c452a79

Contents?: true

Size: 360 Bytes

Versions: 25

Compression:

Stored size: 360 Bytes

Contents

GraphQL::Directive::SkipDirective = GraphQL::Directive.define do
  name "skip"
  description "Ignore this part of the query if `if` is true"
  on([GraphQL::Directive::ON_FIELD, GraphQL::Directive::ON_FRAGMENT])

  argument :if, !GraphQL::BOOLEAN_TYPE

  resolve -> (arguments, proc) {
    if !arguments["if"]
      proc.call
    else
      nil
    end
  }
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
graphql-0.12.1 lib/graphql/directive/skip_directive.rb
graphql-0.12.0 lib/graphql/directive/skip_directive.rb
graphql-0.11.1 lib/graphql/directive/skip_directive.rb
graphql-0.11.0 lib/graphql/directive/skip_directive.rb
graphql-0.10.9 lib/graphql/directive/skip_directive.rb
graphql-0.10.8 lib/graphql/directive/skip_directive.rb
graphql-0.10.7 lib/graphql/directive/skip_directive.rb
graphql-0.10.6 lib/graphql/directive/skip_directive.rb
graphql-0.10.5 lib/graphql/directive/skip_directive.rb
graphql-0.10.4 lib/graphql/directive/skip_directive.rb
graphql-0.10.3 lib/graphql/directive/skip_directive.rb
graphql-0.10.2 lib/graphql/directive/skip_directive.rb
graphql-0.10.1 lib/graphql/directive/skip_directive.rb
graphql-0.10.0 lib/graphql/directive/skip_directive.rb
graphql-0.9.5 lib/graphql/directive/skip_directive.rb
graphql-0.9.4 lib/graphql/directive/skip_directive.rb
graphql-0.9.3 lib/graphql/directive/skip_directive.rb
graphql-0.9.2 lib/graphql/directive/skip_directive.rb
graphql-0.8.1 lib/graphql/directive/skip_directive.rb
graphql-0.8.0 lib/graphql/directive/skip_directive.rb