Sha256: c9b10d924da037f08207df3c2673192f48bbb2bffa58d103f5c562fbeb01ca81

Contents?: true

Size: 365 Bytes

Versions: 25

Compression:

Stored size: 365 Bytes

Contents

GraphQL::Directive::IncludeDirective = GraphQL::Directive.define do
  name "include"
  description "Include 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/include_directive.rb
graphql-0.12.0 lib/graphql/directive/include_directive.rb
graphql-0.11.1 lib/graphql/directive/include_directive.rb
graphql-0.11.0 lib/graphql/directive/include_directive.rb
graphql-0.10.9 lib/graphql/directive/include_directive.rb
graphql-0.10.8 lib/graphql/directive/include_directive.rb
graphql-0.10.7 lib/graphql/directive/include_directive.rb
graphql-0.10.6 lib/graphql/directive/include_directive.rb
graphql-0.10.5 lib/graphql/directive/include_directive.rb
graphql-0.10.4 lib/graphql/directive/include_directive.rb
graphql-0.10.3 lib/graphql/directive/include_directive.rb
graphql-0.10.2 lib/graphql/directive/include_directive.rb
graphql-0.10.1 lib/graphql/directive/include_directive.rb
graphql-0.10.0 lib/graphql/directive/include_directive.rb
graphql-0.9.5 lib/graphql/directive/include_directive.rb
graphql-0.9.4 lib/graphql/directive/include_directive.rb
graphql-0.9.3 lib/graphql/directive/include_directive.rb
graphql-0.9.2 lib/graphql/directive/include_directive.rb
graphql-0.8.1 lib/graphql/directive/include_directive.rb
graphql-0.8.0 lib/graphql/directive/include_directive.rb