source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/operation_preparers/resource_klass_setter_spec.rb
Ruby
mit
202
master
462
# frozen_string_literal: true require 'rails_helper' RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::ResourceKlassSetter do describe '#call' do subject(:prepared_operation) { described_class.new(model).call(operation) } let(:operation) { double(:operation) } let(:model) { User } it ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb
Ruby
mit
202
master
1,567
# frozen_string_literal: true require 'rails_helper' RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::CustomOperationPreparer do describe '#call' do subject(:prepared) { described_class.new(selected_keys: selected_keys, custom_operations: operations, model: model).call } let(:login_operation)...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/operation_preparers/resolver_type_setter_spec.rb
Ruby
mit
202
master
489
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::ResolverTypeSetter do describe '#call' do subject(:prepared_operation) { described_class.new(field_type).call(operation) } let(:operation) { double(:operation) } let(:field_type) { double...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/operation_preparers/default_operation_preparer_spec.rb
Ruby
mit
202
master
3,238
# frozen_string_literal: true require 'rails_helper' RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::DefaultOperationPreparer do describe '#call' do subject(:prepared) { default_preparer.call } let(:default_preparer) { described_class.new(selected_operations: operations, custom_keys: custom...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_sanitizers/hash_checker_spec.rb
Ruby
mit
202
master
2,808
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionSanitizers::HashChecker do describe '#call!' do subject(:clean_value) { described_class.new(element_type).call!(value, key) } let(:key) { :any_option } context 'when a single valid type is provided' do...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_sanitizers/class_checker_spec.rb
Ruby
mit
202
master
1,344
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionSanitizers::ClassChecker do describe '#call!' do subject(:clean_value) { described_class.new(expected_class).call!(value, key) } let(:key) { :any_option } let(:expected_class) { Numeric } ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_sanitizers/string_checker_spec.rb
Ruby
mit
202
master
895
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionSanitizers::StringChecker do describe '#call!' do subject(:clean_value) { described_class.new(default_string).call!(value, key) } let(:key) { :any_option } let(:default_string) { 'default str...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_sanitizers/array_checker_spec.rb
Ruby
mit
202
master
1,181
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionSanitizers::ArrayChecker do describe '#call!' do subject(:clean_value) { described_class.new(element_type).call!(value, key) } let(:key) { :any_option } let(:element_type) { Symbol } conte...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_validators/skip_only_validator_spec.rb
Ruby
mit
202
master
1,081
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionValidators::SkipOnlyValidator do describe '#validate!' do subject { -> { described_class.new(options: options).validate! } } context 'when only `only` key is set' do let(:options) { double(:clean_opti...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_validators/supported_operations_validator_spec.rb
Ruby
mit
202
master
1,382
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionValidators::SupportedOperationsValidator do describe '#validate!' do subject { -> { described_class.new(provided_operations: provided_operations, supported_operations: supported_operations, key: key).validate! }...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/services/mount_method/option_validators/provided_operations_validator_spec.rb
Ruby
mit
202
master
2,347
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OptionValidators::ProvidedOperationsValidator do describe '#validate!' do subject { -> { described_class.new(options: provided_operations, supported_operations: supported_operations).validate! } } let(:supported_...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/user_controller_spec.rb
Ruby
mit
202
master
8,631
# frozen_string_literal: true require 'rails_helper' RSpec.describe "Integrations with the user's controller" do include_context 'with graphql query request' shared_examples 'returns a must authenticate error' do |field| it 'returns a must sign in error' do expect(json_response[:errors]).to contain_exa...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/graphql_controller_spec.rb
Ruby
mit
202
master
2,225
# frozen_string_literal: true require 'rails_helper' RSpec.describe GraphqlDevise::GraphqlController do let(:password) { 'password123' } let(:user) { create(:user, :confirmed, password: password) } let(:params) { { query: query, variables: variables } } context 'when variables are a string' do let(...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/update_password_with_token_spec.rb
Ruby
mit
202
master
3,504
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Update Password With Token' do include_context 'with graphql query request' let(:password) { '12345678' } let(:password_confirmation) { password } context 'when using the user model' do let(:user) { create(:user, :confirme...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/resend_confirmation_with_token_spec.rb
Ruby
mit
202
master
5,048
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Resend confirmation with token' do include_context 'with graphql query request' let(:confirmed_at) { nil } let!(:user) { create(:user, confirmed_at: nil, email: 'mwallace@wallaceinc.com') } let(:email) { user.email } let(:id...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/additional_mutations_spec.rb
Ruby
mit
202
master
1,816
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Additional Mutations' do include_context 'with graphql query request' let(:name) { Faker::Name.name } let(:password) { Faker::Internet.password } let(:password_confirmation) { password } let(:email) ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/additional_queries_spec.rb
Ruby
mit
202
master
650
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Additional Queries' do include_context 'with graphql query request' let(:public_user) { create(:user, :confirmed) } context 'when using the user model' do let(:query) do <<-GRAPHQL query { publicUser( ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/confirm_registration_with_token_spec.rb
Ruby
mit
202
master
3,187
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Registration confirmation with token' do include_context 'with graphql query request' context 'when using the user model' do let(:user) { create(:user, confirmed_at: nil) } let(:query) do <<-GRAPHQL mutation { us...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/logout_spec.rb
Ruby
mit
202
master
1,784
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Logout Requests' do include_context 'with graphql query request' let(:user) { create(:user, :confirmed) } let(:query) do <<-GRAPHQL mutation { userLogout { authenticatable { email } } } GRAPHQL ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/send_password_reset_with_token_spec.rb
Ruby
mit
202
master
2,478
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Send Password Reset Requests' do include_context 'with graphql query request' let!(:user) { create(:user, :confirmed, email: 'jwinnfield@wallaceinc.com') } let(:email) { user.email } let(:redirect_url) { 'https://google.com' }...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/register_spec.rb
Ruby
mit
202
master
4,926
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Registration process' do include_context 'with graphql query request' let(:name) { Faker::Name.name } let(:password) { Faker::Internet.password } let(:email) { Faker::Internet.email } let(:redirect) { 'https://google.com' } cont...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/mutations/login_spec.rb
Ruby
mit
202
master
7,002
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Login Requests' do include_context 'with graphql query request' let(:password) { '12345678' } context 'when using the user model' do let!(:user) { create(:user, :confirmed, password: password, email: 'vvega@wallaceinc.com') } let(:em...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/requests/queries/introspection_query_spec.rb
Ruby
mit
202
master
3,864
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Login Requests' do include_context 'with graphql query request' let(:query) do <<-GRAPHQL query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { name } ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/support/matchers/auth_headers_matcher.rb
Ruby
mit
202
master
228
# frozen_string_literal: true RSpec::Matchers.define :include_auth_headers do match do |response| auth_headers = %w[uid access-token client].map { |key| response.headers[key] } auth_headers.all?(&:present?) end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/support/requests/json_helpers.rb
Ruby
mit
202
master
320
# frozen_string_literal: true module Requests module JsonHelpers def json_response parsed_response = JSON.parse(response.body) if parsed_response.instance_of?(Array) parsed_response.map(&:deep_symbolize_keys) else parsed_response.deep_symbolize_keys end end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/support/contexts/schema_test.rb
Ruby
mit
202
master
486
# frozen_string_literal: true RSpec.shared_context 'with graphql schema test' do let(:variables) { {} } let(:resource_names) { [:user] } let(:resource) { nil } let(:controller) { instance_double(GraphqlDevise::GraphqlController) } let(:context) do { current_resource: resource, controller: ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/support/contexts/graphql_request.rb
Ruby
mit
202
master
503
# frozen_string_literal: true RSpec.shared_context 'with graphql query request' do let(:headers) { {} } let(:variables) { {} } let(:graphql_params) do { params: { query: query, variables: variables }, headers: headers } end def post_request(path = '/api/v1/graphql_auth') send_request(path, :post) ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/models/user_spec.rb
Ruby
mit
202
master
203
# frozen_string_literal: true require 'rails_helper' RSpec.describe User do it 'responds to included concern method' do user = described_class.new expect(user).not_to be_persisted end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/generators/graphql_devise/install_generator_spec.rb
Ruby
mit
202
master
3,856
# frozen_string_literal: true # Generators are not automatically loaded by Rails require 'rails_helper' require 'generators/graphql_devise/install_generator' # NOTE: Skipping tests because of a problem between zeitwerk and GQL versions 2.1.0 & 2.2.14 skip_generator_tests = Gem::Version.new(GraphQL::VERSION).between...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/graphql_devise/model/with_email_updater_spec.rb
Ruby
mit
202
master
5,270
# frozen_string_literal: true require 'rails_helper' RSpec.describe GraphqlDevise::Model::WithEmailUpdater do describe '#call' do shared_examples 'all required arguments are provided' do |base_attributes| let(:attributes) { base_attributes.merge(email: 'new@gmail.com', name: 'Updated Name') } it 'p...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/routes.rb
Ruby
mit
202
master
1,123
# frozen_string_literal: true Rails.application.routes.draw do mount_graphql_devise_for( User, at: '/api/v1/graphql_auth', base_controller: CookiesController, operations: { login: Mutations::Login, register: Mutations::Register }, additional_mutations: { register_confirmed_user: Mutations::Regist...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/application.rb
Ruby
mit
202
master
1,121
# frozen_string_literal: true require 'rails' require 'active_model/railtie' require 'active_job/railtie' require 'active_record/railtie' require 'action_controller/railtie' require 'action_mailer/railtie' require 'action_view/railtie' # Require the gems listed in Gemfile, including any gems # you've limited to :test...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/environments/test.rb
Ruby
mit
202
master
1,853
# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "s...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/environments/development.rb
Ruby
mit
202
master
1,700
# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/environments/production.rb
Ruby
mit
202
master
3,212
# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, a...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/initializers/devise_token_auth.rb
Ruby
mit
202
master
2,808
# frozen_string_literal: true DeviseTokenAuth.setup do |config| # By default the authorization headers will change after each request. The # client is responsible for keeping track of the changing tokens. Change # this to false to prevent the Authorization header from changing after # each request. config.ch...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/config/initializers/devise.rb
Ruby
mit
202
master
10,621
# frozen_string_literal: true # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render inv...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/controllers/api/v1/graphql_controller.rb
Ruby
mit
202
master
1,214
# frozen_string_literal: true module Api module V1 class GraphqlController < ApplicationController include GraphqlDevise::SetUserByToken include ActionController::Cookies def graphql result = DummySchema.execute(params[:query], **execute_params(params)) render json: result unl...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/models/guest.rb
Ruby
mit
202
master
214
# frozen_string_literal: true class Guest < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :validatable include GraphqlDevise::Authenticatable end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/models/user.rb
Ruby
mit
202
master
456
# frozen_string_literal: true class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :lockable, :validatable, :confirmable include GraphqlDevise::Authenticatable validates :name, pre...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/models/admin.rb
Ruby
mit
202
master
237
# frozen_string_literal: true class Admin < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :validatable, :confirmable include GraphqlDevise::Authenticatable end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/models/schema_user.rb
Ruby
mit
202
master
274
# frozen_string_literal: true class SchemaUser < ApplicationRecord devise :database_authenticatable, :recoverable, :trackable, :validatable, :confirmable include GraphqlDevise::Authenticatable validates :name, presence: true end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/models/users/customer.rb
Ruby
mit
202
master
223
# frozen_string_literal: true module Users class Customer < ApplicationRecord devise :database_authenticatable, :validatable include GraphqlDevise::Authenticatable validates :name, presence: true end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/dummy_schema.rb
Ruby
mit
202
master
597
# frozen_string_literal: true class DummySchema < GraphQL::Schema use GraphqlDevise::SchemaPlugin.new( query: Types::QueryType, mutation: Types::MutationType, public_introspection: true, resource_loaders: [ GraphqlDevise::ResourceLoader.new( User, ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/interpreter_schema.rb
Ruby
mit
202
master
579
# frozen_string_literal: true class InterpreterSchema < GraphQL::Schema if Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new('1.9.0') && Gem::Version.new(GraphQL::VERSION) < Gem::Version.new('2.0') use GraphQL::Execution::Interpreter end if Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new('1.10.0'...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/mutations/login.rb
Ruby
mit
202
master
364
# frozen_string_literal: true module Mutations class Login < GraphqlDevise::Mutations::Login field :user, Types::UserType, null: true def resolve(email:, password:) original_payload = super do |user| user.do_something user.reload end original_payload.merge(user: original_p...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/mutations/register_confirmed_user.rb
Ruby
mit
202
master
675
# frozen_string_literal: true module Mutations class RegisterConfirmedUser < GraphqlDevise::Mutations::Base argument :email, String, required: true argument :name, String, required: true argument :password, String, required: true argument :password_confir...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/mutations/reset_admin_password_with_token.rb
Ruby
mit
202
master
328
# frozen_string_literal: true module Mutations class ResetAdminPasswordWithToken < GraphqlDevise::Mutations::UpdatePasswordWithToken field :authenticatable, Types::AdminType, null: false def resolve(reset_password_token:, **attrs) super do |admin| controller.sign_in(admin) end end ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/mutations/update_user.rb
Ruby
mit
202
master
424
# frozen_string_literal: true module Mutations class UpdateUser < BaseMutation field :user, Types::UserType, null: false argument :email, String, required: false argument :name, String, required: false def resolve(**attrs) user = context[:current_resource] user.update_with_email( ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/mutations/register.rb
Ruby
mit
202
master
346
# frozen_string_literal: true module Mutations class Register < GraphqlDevise::Mutations::Register argument :name, String, required: false field :user, Types::UserType, null: true def resolve(email:, **attrs) original_payload = super original_payload.merge(user: original_payload[:authentica...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/resolvers/public_user.rb
Ruby
mit
202
master
232
# frozen_string_literal: true module Resolvers class PublicUser < GraphQL::Schema::Resolver type Types::UserType, null: false argument :id, Int, required: true def resolve(id:) User.find(id) end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/resolvers/user_show.rb
Ruby
mit
202
master
230
# frozen_string_literal: true module Resolvers class UserShow < GraphQL::Schema::Resolver type Types::UserType, null: false argument :id, Int, required: true def resolve(id:) User.find(id) end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/types/user_type.rb
Ruby
mit
202
master
267
# frozen_string_literal: true module Types class UserType < BaseObject field :id, Int, null: false field :email, String, null: false field :name, String, null: false field :sign_in_count, Int, null: true end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/types/custom_admin_type.rb
Ruby
mit
202
master
242
# frozen_string_literal: true module Types class CustomAdminType < BaseObject field :email, String, null: false field :custom_field, String, null: false def custom_field "email: #{object.email}" end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/types/query_type.rb
Ruby
mit
202
master
845
# frozen_string_literal: true module Types class QueryType < BaseObject field_class GraphqlDevise::Types::BaseField if Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new('2.0') field :user, resolver: Resolvers::UserShow field :public_field, String, null: false, authenticate: false field :private...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/app/graphql/types/mutation_type.rb
Ruby
mit
202
master
434
# frozen_string_literal: true module Types class MutationType < BaseObject field_class GraphqlDevise::Types::BaseField if Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new('2.0') field :dummy_mutation, String, null: false, authenticate: true field :update_user, mutation: Mutations::UpdateUser ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/db/schema.rb
Ruby
mit
202
master
5,694
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/db/migrate/20191013213045_create_guests.rb
Ruby
mit
202
master
1,050
# frozen_string_literal: true class CreateGuests < ActiveRecord::Migration[6.0] def change create_table :guests do |t| ## Required t.string :provider, null: false, default: 'email' t.string :uid, null: false, default: '' ## Database authenticatable t.string :encrypted_password, nul...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/db/migrate/20190916012505_create_admins.rb
Ruby
mit
202
master
1,050
# frozen_string_literal: true class CreateAdmins < ActiveRecord::Migration[5.2] def change create_table :admins do |t| ## Required t.string :provider, null: false, default: 'email' t.string :uid, null: false, default: '' ## Database authenticatable t.string :encrypted_password, nul...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/db/migrate/20190815114303_create_users.rb
Ruby
mit
202
master
1,603
# frozen_string_literal: true class CreateUsers < ActiveRecord::Migration[5.2] def change create_table :users do |t| ## Required t.string :provider, null: false, default: 'email' t.string :uid, null: false, default: '' ## Database authenticatable t.string :encrypted_password, null:...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/db/migrate/20200321121807_create_users_customers.rb
Ruby
mit
202
master
512
# frozen_string_literal: true class CreateUsersCustomers < ActiveRecord::Migration[6.0] def change create_table :users_customers do |t| ## Required t.string :provider, null: false, default: 'email' t.string :uid, null: false, default: '' ## Database authenticatable t.string :encryp...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
spec/dummy/db/migrate/20200623003142_create_schema_users.rb
Ruby
mit
202
master
1,233
# frozen_string_literal: true class CreateSchemaUsers < ActiveRecord::Migration[6.0] def change create_table :schema_users do |t| ## Required t.string :provider, null: false, default: 'email' t.string :uid, null: false, default: '' ## Database authenticatable t.string :encrypted_pa...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
app/controllers/graphql_devise/graphql_controller.rb
Ruby
mit
202
master
233
# frozen_string_literal: true require_dependency 'graphql_devise/application_controller' module GraphqlDevise class GraphqlController < ApplicationController include SetUserByToken include AuthControllerMethods end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
config/routes.rb
Ruby
mit
202
master
570
# frozen_string_literal: true GraphqlDevise::Engine.routes.draw do # Required as Devise forces routes to reload on eager_load unless GraphqlDevise.schema_loaded? if GraphqlDevise::Types::QueryType.fields.blank? GraphqlDevise::Types::QueryType.field(:dummy, resolver: GraphqlDevise::Resolvers::Dummy) e...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
bin/install_bundler.rb
Ruby
mit
202
master
311
#!ruby ruby_version = Gem::Version.new(RUBY_VERSION) if ruby_version < Gem::Version.new('2.6') system('gem install bundler -v 2.3.27') elsif ruby_version >= Gem::Version.new('2.6') && ruby_version < Gem::Version.new('3.0') system('gem install bundler -v 2.4.22') else system('gem install bundler') end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise.rb
Ruby
mit
202
master
1,887
# frozen_string_literal: true require 'rails' require 'rails/generators' require 'graphql' require 'devise_token_auth' require 'zeitwerk' if Gem::Version.new(GraphQL::VERSION) < Gem::Version.new('2.0') GraphQL::Field.accepts_definitions(authenticate: GraphQL::Define.assign_metadata_key(:authenticate)) GraphQL::Sc...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/generators/graphql_devise/install_generator.rb
Ruby
mit
202
master
3,128
# frozen_string_literal: true module GraphqlDevise class InstallGenerator < ::Rails::Generators::Base source_root File.expand_path('templates', __dir__) argument :user_class, type: :string, default: 'User' argument :mount_path, type: :string, default: 'graphql_auth' class_option :mount, type: :stri...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/route_mounter.rb
Ruby
mit
202
master
745
module GraphqlDevise module RouteMounter def mount_graphql_devise_for(resource, options = {}) routing = 'graphql_devise/graphql#auth' if (base_controller = options.delete(:base_controller)) new_controller = GraphqlDevise.const_set("#{resource}AuthController", Class.new(base_controller)) ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/field_auth_tracer.rb
Ruby
mit
202
master
1,414
# frozen_string_literal: true module GraphqlDevise module FieldAuthTracer def initialize(authenticate_default:, public_introspection:, unauthenticated_proc:, **_rest) @authenticate_default = authenticate_default @public_introspection = public_introspection @unauthenticated_proc = unauthenticate...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/resource_loader.rb
Ruby
mit
202
master
5,176
# frozen_string_literal: true module GraphqlDevise class ResourceLoader def initialize(resource, options = {}, routing = false) @resource = resource @options = options @routing = routing @default_operations = DefaultOperations::MUTATIONS.merge(DefaultOperat...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/schema_plugin.rb
Ruby
mit
202
master
3,865
# frozen_string_literal: true module GraphqlDevise class SchemaPlugin # NOTE: Based on GQL-Ruby docs https://graphql-ruby.org/schema/introspection.html INTROSPECTION_FIELDS = ['__schema', '__type', '__typename'] DEFAULT_NOT_AUTHENTICATED = ->(field) { raise AuthenticationError, "#{field} field requires ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/default_operations.rb
Ruby
mit
202
master
870
# frozen_string_literal: true module GraphqlDevise module DefaultOperations QUERIES = {}.freeze MUTATIONS = { login: { klass: Mutations::Login, authenticatable: true }, logout: { klass: Mutations::Logout, authenticatable: true }, register: ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/resolvers/base.rb
Ruby
mit
202
master
201
# frozen_string_literal: true require 'devise_token_auth/version' module GraphqlDevise module Resolvers class Base < GraphQL::Schema::Resolver include ControllerMethods end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/resolvers/dummy.rb
Ruby
mit
202
master
369
# frozen_string_literal: true module GraphqlDevise module Resolvers class Dummy < Base type String, null: false description 'Field necessary as at least one query must be present in the schema' def resolve 'Dummy field necessary as graphql-ruby gem requires at least one query to be pre...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/errors/detailed_user_error.rb
Ruby
mit
202
master
341
# frozen_string_literal: true module GraphqlDevise class DetailedUserError < ExecutionError def initialize(message, errors:) @message = message @errors = errors super(message) end def to_h super.merge(extensions: { code: ERROR_CODES.fetch(:user_error), detailed_errors: @errors ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/errors/authentication_error.rb
Ruby
mit
202
master
210
# frozen_string_literal: true module GraphqlDevise class AuthenticationError < ExecutionError def to_h super.merge(extensions: { code: ERROR_CODES.fetch(:authentication_error) }) end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/model/with_email_updater.rb
Ruby
mit
202
master
2,120
# frozen_string_literal: true module GraphqlDevise module Model class WithEmailUpdater def initialize(resource, attributes) @attributes = attributes.with_indifferent_access @resource = resource end def call resource_attributes = @attributes.except(:confirmation_url) ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_sanitizer.rb
Ruby
mit
202
master
633
# frozen_string_literal: true module GraphqlDevise module MountMethod class OperationSanitizer def self.call(default:, only:, skipped:) new( default: default, only: only, skipped: skipped ).call end def initialize(default:, only:, skipped:) ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_sanitizer.rb
Ruby
mit
202
master
509
# frozen_string_literal: true module GraphqlDevise module MountMethod class OptionSanitizer def initialize(options = {}, supported_options = MountMethod::SUPPORTED_OPTIONS) @options = options @supported_options = supported_options end def call! @supported_opti...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparer.rb
Ruby
mit
202
master
1,273
# frozen_string_literal: true module GraphqlDevise module MountMethod class OperationPreparer def initialize(model:, selected_operations:, preparer:, custom:, additional_operations:) @selected_operations = selected_operations @preparer = preparer @model ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/options_validator.rb
Ruby
mit
202
master
268
# frozen_string_literal: true module GraphqlDevise module MountMethod class OptionsValidator def initialize(validators = []) @validators = validators end def validate! @validators.each(&:validate!) end end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/supported_options.rb
Ruby
mit
202
master
735
# frozen_string_literal: true module GraphqlDevise module MountMethod SUPPORTED_OPTIONS = { at: OptionSanitizers::StringChecker.new('/graphql_auth'), operations: OptionSanitizers::HashChecker.new([GraphQL::Schema::Resolver, GraphQL::Schema::Mutation]), only: ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparers/mutation_field_setter.rb
Ruby
mit
202
master
486
# frozen_string_literal: true module GraphqlDevise module MountMethod module OperationPreparers class MutationFieldSetter def initialize(authenticatable_type) @authenticatable_type = authenticatable_type end def call(mutation, authenticatable: true) return mutat...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparers/default_operation_preparer.rb
Ruby
mit
202
master
1,300
# frozen_string_literal: true module GraphqlDevise module MountMethod module OperationPreparers class DefaultOperationPreparer def initialize(selected_operations:, custom_keys:, model:, preparer:) @selected_operations = selected_operations @custom_keys = custom_keys ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparers/gql_name_setter.rb
Ruby
mit
202
master
454
# frozen_string_literal: true module GraphqlDevise module MountMethod module OperationPreparers class GqlNameSetter def initialize(mapping_name) @mapping_name = mapping_name end def call(operation, **) operation.graphql_name(graphql_name) operation ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparers/resolver_type_setter.rb
Ruby
mit
202
master
398
# frozen_string_literal: true module GraphqlDevise module MountMethod module OperationPreparers class ResolverTypeSetter def initialize(authenticatable_type) @authenticatable_type = authenticatable_type end def call(resolver, **) resolver.type(@authenticatable_t...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparers/resource_klass_setter.rb
Ruby
mit
202
master
364
# frozen_string_literal: true module GraphqlDevise module MountMethod module OperationPreparers class ResourceKlassSetter def initialize(klass) @klass = klass end def call(operation, **) operation.instance_variable_set(:@resource_klass, @klass) operat...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/operation_preparers/custom_operation_preparer.rb
Ruby
mit
202
master
930
# frozen_string_literal: true module GraphqlDevise module MountMethod module OperationPreparers class CustomOperationPreparer def initialize(selected_keys:, custom_operations:, model:) @selected_keys = selected_keys @custom_operations = custom_operations @model ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_validators/supported_operations_validator.rb
Ruby
mit
202
master
780
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionValidators class SupportedOperationsValidator def initialize(provided_operations: [], supported_operations: [], key:) @provided_operations = provided_operations @supported_operations = supported_...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_validators/skip_only_validator.rb
Ruby
mit
202
master
502
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionValidators class SkipOnlyValidator def initialize(options:) @options = options end def validate! if [@options.skip, @options.only].all?(&:present?) raise( ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
Ruby
mit
202
master
878
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionValidators class ProvidedOperationsValidator def initialize(options:, supported_operations:) @options = options @supported_operations = supported_operations end def v...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_sanitizers/hash_checker.rb
Ruby
mit
202
master
713
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionSanitizers class HashChecker def initialize(element_type_array) @element_type_array = Array(element_type_array) @default_value = {} end def call!(value, key) return...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_sanitizers/array_checker.rb
Ruby
mit
202
master
743
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionSanitizers class ArrayChecker def initialize(element_type) @element_type = element_type @default_value = [] end def call!(value, key) return @default_value if value.bla...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_sanitizers/class_checker.rb
Ruby
mit
202
master
745
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionSanitizers class ClassChecker def initialize(klass) @klass_array = Array(klass) end def call!(value, key) return if value.nil? unless value.instance_of?(Class) ...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/mount_method/option_sanitizers/string_checker.rb
Ruby
mit
202
master
524
# frozen_string_literal: true module GraphqlDevise module MountMethod module OptionSanitizers class StringChecker def initialize(default_string = nil) @default_string = default_string end def call!(value, key) return @default_string if value.blank? un...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/types/query_type.rb
Ruby
mit
202
master
303
# frozen_string_literal: true module GraphqlDevise module Types class QueryType < GraphQL::Schema::Object field_class GraphqlDevise::Types::BaseField if Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new('2.0') has_no_fields(true) if respond_to?(:has_no_fields) end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/types/credential_type.rb
Ruby
mit
202
master
789
# frozen_string_literal: true module GraphqlDevise module Types class CredentialType < BaseType field :access_token, String, null: false field :uid, String, null: false field :token_type, String, null: false field :client, String, null: false field :expiry, In...
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/types/mutation_type.rb
Ruby
mit
202
master
306
# frozen_string_literal: true module GraphqlDevise module Types class MutationType < GraphQL::Schema::Object field_class GraphqlDevise::Types::BaseField if Gem::Version.new(GraphQL::VERSION) >= Gem::Version.new('2.0') has_no_fields(true) if respond_to?(:has_no_fields) end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/concerns/authenticatable.rb
Ruby
mit
202
master
296
# frozen_string_literal: true module GraphqlDevise module Authenticatable extend ActiveSupport::Concern included do include DeviseTokenAuth::Concerns::User include AdditionalModelMethods ::GraphqlDevise.configure_warden_serializer_for_model(self) end end end
github
graphql-devise/graphql_devise
https://github.com/graphql-devise/graphql_devise
lib/graphql_devise/concerns/additional_controller_methods.rb
Ruby
mit
202
master
1,214
# frozen_string_literal: true module GraphqlDevise module AdditionalControllerMethods extend ActiveSupport::Concern included do attr_accessor :client_id, :token, :resource end def gql_devise_context(*models) { current_resource: authenticate_model(*models), controller: ...