Sha256: a79f0cc2e3fa592029c411f325274412821df045ed035a2e95f5092244fbb21a

Contents?: true

Size: 597 Bytes

Versions: 6

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

module Types
  class QueryType < Types::BaseObject
    field :user, resolver: Resolvers::UserShow
    field :public_field, String, null: false, authenticate: false
    field :private_field, String, null: false, authenticate: true
    field :vip_field, String, null: false, authenticate: ->(user) { user.is_a?(User) && user.vip? }

    def public_field
      'Field does not require authentication'
    end

    def private_field
      'Field will always require authentication'
    end

    def vip_field
      'Field available only for VIP Users'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
graphql_devise-0.18.2 spec/dummy/app/graphql/types/query_type.rb
graphql_devise-0.18.1 spec/dummy/app/graphql/types/query_type.rb
graphql_devise-0.18.0 spec/dummy/app/graphql/types/query_type.rb
graphql_devise-0.17.1 spec/dummy/app/graphql/types/query_type.rb
graphql_devise-0.17.0 spec/dummy/app/graphql/types/query_type.rb
graphql_devise-0.16.0 spec/dummy/app/graphql/types/query_type.rb