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 | doorkeeper-gem/doorkeeper | https://github.com/doorkeeper-gem/doorkeeper | lib/generators/doorkeeper/previous_refresh_token_generator.rb | Ruby | mit | 5,477 | main | 1,132 | # frozen_string_literal: true
require "rails/generators"
require "rails/generators/active_record"
module Doorkeeper
# Generates migration to add previous refresh token column to the
# database for Doorkeeper tables.
#
class PreviousRefreshTokenGenerator < ::Rails::Generators::Base
include ::Rails::Generat... |
github | doorkeeper-gem/doorkeeper | https://github.com/doorkeeper-gem/doorkeeper | lib/generators/doorkeeper/migration_generator.rb | Ruby | mit | 5,477 | main | 826 | # frozen_string_literal: true
require "rails/generators"
require "rails/generators/active_record"
module Doorkeeper
# Copies main Doorkeeper migration into parent Rails application.
#
class MigrationGenerator < ::Rails::Generators::Base
include ::Rails::Generators::Migration
source_root File.expand_path... |
github | doorkeeper-gem/doorkeeper | https://github.com/doorkeeper-gem/doorkeeper | lib/generators/doorkeeper/remove_applications_secret_not_null_constraint_generator.rb | Ruby | mit | 5,477 | main | 1,036 | # frozen_string_literal: true
require "rails/generators"
require "rails/generators/active_record"
module Doorkeeper
# Generates migration with which drops NOT NULL constraint and allows not
# to bloat the database with redundant secret value.
#
class RemoveApplicationsSecretNotNullConstraintGenerator < ::Rail... |
github | doorkeeper-gem/doorkeeper | https://github.com/doorkeeper-gem/doorkeeper | lib/generators/doorkeeper/install_generator.rb | Ruby | mit | 5,477 | main | 655 | # frozen_string_literal: true
require "rails/generators"
require "rails/generators/active_record"
module Doorkeeper
# Setup doorkeeper into Rails application: locales, routes, etc.
#
class InstallGenerator < ::Rails::Generators::Base
include ::Rails::Generators::Migration
source_root File.expand_path("t... |
github | doorkeeper-gem/doorkeeper | https://github.com/doorkeeper-gem/doorkeeper | lib/generators/doorkeeper/templates/initializer.rb | Ruby | mit | 5,477 | main | 23,890 | # frozen_string_literal: true
Doorkeeper.configure do
# Change the ORM that doorkeeper will use (requires ORM extensions installed).
# Check the list of supported ORMs here: https://github.com/doorkeeper-gem/doorkeeper#orms
orm :active_record
# Enable support for multiple database configurations with read rep... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | Rakefile | Ruby | mit | 5,430 | master | 5,815 | # frozen_string_literal: true
require "bundler/gem_helper"
Bundler::GemHelper.install_tasks
require "rake/testtask"
require_relative "guides/_tasks/site"
require_relative "lib/graphql/rake_task/validate"
require 'rake/extensiontask'
Rake::TestTask.new do |t|
t.libs << "spec" << "lib" << "graphql-c_parser/lib"
ex... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | graphql.gemspec | Ruby | mit | 5,430 | master | 2,272 | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
require "graphql/version"
require "date"
Gem::Specification.new do |s|
s.name = "graphql"
s.version = GraphQL::VERSION
s.date = Date.today.to_s
s.summary = "A GraphQL language and runtime for Ruby"
s.desc... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | Gemfile | Ruby | mit | 5,430 | master | 469 | # frozen_string_literal: true
source "https://rubygems.org"
gemspec
gem 'bootsnap' # required by the Rails apps generated in tests
gem 'stackprof', platform: :ruby
gem 'pry'
gem 'pry-stack_explorer', platform: :ruby
if RUBY_VERSION >= "3.2.0"
gem "async", "~>2.0"
gem "minitest-mock"
end
# Required for running `... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql_spec.rb | Ruby | mit | 5,430 | master | 911 | # frozen_string_literal: true
require "spec_helper"
require "open3"
describe GraphQL do
it "loads without warnings" do
stderr_and_stdout, _status = Open3.capture2e(%|ruby -Ilib -e "require 'bundler/inline'; gemfile(true, quiet: true) { source('https://rubygems.org'); gem('graphql', path: './') }; GraphQL.eager_l... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/spec_helper.rb | Ruby | mit | 5,430 | master | 5,799 | # frozen_string_literal: true
require 'rubygems'
require 'bundler'
require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::LcovFormatter
]
SimpleCov.start do
enable_co... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/data.rb | Ruby | mit | 5,430 | master | 2,201 | # frozen_string_literal: true
require 'ostruct'
require "support/active_record_setup"
module StarWars
names = [
'X-Wing',
'Y-Wing',
'A-Wing',
'Millennium Falcon',
'Home One',
'TIE Fighter',
'TIE Interceptor',
'Executor',
]
class StarWarsModel < ActiveRecord::Base
self.abstrac... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/query_logs_spec.rb | Ruby | mit | 5,430 | master | 4,074 | # frozen_string_literal: true
require "spec_helper"
describe "Integration with ActiveRecord::QueryLogs" do
class QueryLogSchema < GraphQL::Schema
class Thing < ActiveRecord::Base
belongs_to :other_thing, class_name: "Thing"
end
class ThingSource < GraphQL::Dataloader::Source
def fetch(ids)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/spec_helper.rb | Ruby | mit | 5,430 | master | 1,077 | # frozen_string_literal: true
require "rake"
require "rails/all"
require "rails/generators"
require "sequel"
if ENV['DATABASE'] == 'POSTGRESQL'
require 'pg'
else
require "sqlite3"
end
if ENV["ISOLATION_LEVEL_FIBER"]
ActiveSupport::IsolatedExecutionState.isolation_level = :fiber
puts "ActiveSupport::IsolatedEx... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/relay_generator_spec.rb | Ruby | mit | 5,430 | master | 2,300 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/relay_generator"
require "generators/graphql/install_generator"
class GraphQLGeneratorsRelayGeneratorTest < Rails::Generators::TestCase
tests Graphql::Generators::RelayGenerator
destination File.expand_path("../../../tmp/dummy", File.d... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/mutation_delete_generator_spec.rb | Ruby | mit | 5,430 | master | 2,743 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/mutation_delete_generator"
class GraphQLGeneratorsMutationDeleteGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::MutationDeleteGenerator
destination File.expand_path("../../../tmp/dummy", File.dirname(__FILE__))
setup :... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/interface_generator_spec.rb | Ruby | mit | 5,430 | master | 1,701 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/interface_generator"
class GraphQLGeneratorsInterfaceGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::InterfaceGenerator
test "it generates fields with types" do
commands = [
# GraphQL-style:
["Bird", "wing... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/mutation_update_generator_spec.rb | Ruby | mit | 5,430 | master | 2,745 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/mutation_update_generator"
class GraphQLGeneratorsMutationUpdateGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::MutationUpdateGenerator
destination File.expand_path("../../../tmp/dummy", File.dirname(__FILE__))
setup :... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/scalar_generator_spec.rb | Ruby | mit | 5,430 | master | 1,463 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/scalar_generator"
class GraphQLGeneratorsScalarGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::ScalarGenerator
test "it generates scalar class" do
expected_content = <<-RUBY
# frozen_string_literal: true
module Types... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/union_generator_spec.rb | Ruby | mit | 5,430 | master | 1,871 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/union_generator"
class GraphQLGeneratorsUnionGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::UnionGenerator
test "it generates a union with possible types" do
commands = [
# GraphQL-style:
["WingedCreature... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/object_generator_spec.rb | Ruby | mit | 5,430 | master | 3,510 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/object_generator"
class GraphQLGeneratorsObjectGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::ObjectGenerator
# rubocop:disable Style/ClassAndModuleChildren
class ::TestUser < ActiveRecord::Base
end
# rubocop:enabl... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/mutation_generator_spec.rb | Ruby | mit | 5,430 | master | 2,670 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/mutation_generator"
require "generators/graphql/install_generator"
class GraphQLGeneratorsMutationGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::MutationGenerator
setup :prepare_destination
UPDATE_NAME_MUTATION = <<-R... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/detailed_trace_generator_spec.rb | Ruby | mit | 5,430 | master | 2,479 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/install_generator"
require "generators/graphql/detailed_trace_generator"
class GraphQLGeneratorsDetailedTraceGeneratorTest < Rails::Generators::TestCase
tests Graphql::Generators::DetailedTraceGenerator
destination File.expand_path("..... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/enum_generator_spec.rb | Ruby | mit | 5,430 | master | 1,528 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/enum_generator"
class GraphQLGeneratorsEnumGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::EnumGenerator
test "it generate enums with values" do
expected_content = <<-RUBY
# frozen_string_literal: true
module Types
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/mutation_create_generator_spec.rb | Ruby | mit | 5,430 | master | 2,620 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/mutation_create_generator"
class GraphQLGeneratorsMutationCreateGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::MutationCreateGenerator
destination File.expand_path("../../../tmp/dummy", File.dirname(__FILE__))
setup :... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/install_generator_spec.rb | Ruby | mit | 5,430 | master | 13,673 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/install_generator"
class GraphQLGeneratorsInstallGeneratorTest < Rails::Generators::TestCase
tests Graphql::Generators::InstallGenerator
destination File.expand_path("../../../tmp/dummy", File.dirname(__FILE__))
setup do
prepare... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/loader_generator_spec.rb | Ruby | mit | 5,430 | master | 1,597 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/loader_generator"
class GraphQLGeneratorsLoaderGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::LoaderGenerator
test "it generates an empty loader by name" do
run_generator(["RecordLoader"])
expected_content = <<-... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/generators/graphql/input_generator_spec.rb | Ruby | mit | 5,430 | master | 3,758 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/input_generator"
class GraphQLGeneratorsInputGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::InputGenerator
# rubocop:disable Style/ClassAndModuleChildren
class ::InputTestUser < ActiveRecord::Base
end
# rubocop:ena... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/input_object_spec.rb | Ruby | mit | 5,430 | master | 610 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Schema::InputObject do
let(:input_object) do
Dummy::DairyProductInput.new(
nil,
ruby_kwargs: { source: 'COW', fatContent: 0.8 },
defaults_used: Set.new,
context: GraphQL::Query::NullContext.instance)
end
describe ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/dataloader_spec.rb | Ruby | mit | 5,430 | master | 3,680 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Dataloader do
if defined?(ActiveRecord::Promise) && ENV['DATABASE'] == 'POSTGRESQL' # Rails 7.1+
class RailsPromiseSchema < GraphQL::Schema
class LoadAsyncSource < GraphQL::Dataloader::Source
LOG = []
def fetch(relations)... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/schema_spec.rb | Ruby | mit | 5,430 | master | 12,789 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Schema do
let(:schema) { Dummy::Schema }
let(:admin_schema) { Dummy::AdminSchema }
let(:relay_schema) { StarWars::Schema }
let(:empty_schema) { Class.new(GraphQL::Schema) }
describe "#find" do
it "finds a member using a string path" ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/types/iso_8601_duration_spec.rb | Ruby | mit | 5,430 | master | 3,846 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Types::ISO8601Duration do
module DurationTest
class Schema < GraphQL::Schema
def self.type_error(err, ctx)
raise err
end
end
end
let(:context) { GraphQL::Query.new(DurationTest::Schema, "{ __typename }").context }
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/relay/connection_type_spec.rb | Ruby | mit | 5,430 | master | 3,269 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Relay::ConnectionType" do
describe ".create_type" do
describe "connections with custom Edge classes / EdgeTypes" do
let(:query_string) {%|
query($testNames: Boolean!) {
rebels {
basesWithCustomEdge {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/relay/relation_connection_spec.rb | Ruby | mit | 5,430 | master | 23,503 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Relay::RelationConnection" do
def get_names(result)
ships = result["data"]["empire"]["bases"]["edges"]
ships.map { |e| e["node"]["name"] }
end
def get_page_info(result)
result["data"]["empire"]["bases"]["pageInfo"]
end
def g... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/relay/range_add_spec.rb | Ruby | mit | 5,430 | master | 3,252 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Relay::RangeAdd do
# Make sure that the encoder is found through `ctx.schema`:
module PassThroughEncoder
def self.encode(unencoded_text, nonce: false)
"__#{unencoded_text}"
end
def self.decode(encoded_text, nonce: false)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/relay/array_connection_spec.rb | Ruby | mit | 5,430 | master | 11,856 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Relay::ArrayConnection" do
def get_names(result)
ships = result["data"]["rebels"]["ships"]["edges"]
ships.map { |e| e["node"]["name"] }
end
def get_last_cursor(result)
result["data"]["rebels"]["ships"]["edges"].last["cursor"]
e... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/relay/page_info_spec.rb | Ruby | mit | 5,430 | master | 5,126 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Relay::PageInfo" do
def get_page_info(result)
result["data"]["empire"]["bases"]["pageInfo"]
end
def get_first_cursor(result)
result["data"]["empire"]["bases"]["edges"].first["cursor"]
end
def get_last_cursor(result)
result["... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/relay/connection_resolve_spec.rb | Ruby | mit | 5,430 | master | 1,734 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Relay::ConnectionResolve" do
let(:query_string) { <<-GRAPHQL
query getShips($name: String!, $testParentName: Boolean = false){
rebels {
ships(nameIncludes: $name) {
edges {
node {
name
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/dataloader/async_dataloader_spec.rb | Ruby | mit | 5,430 | master | 3,110 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Dataloader::AsyncDataloader do
class RailsAsyncSchema < GraphQL::Schema
class CustomAsyncDataloader < GraphQL::Dataloader::AsyncDataloader
def cleanup_fiber
end
def get_fiber_variables
vars = super
vars[:conn... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/query/variables_spec.rb | Ruby | mit | 5,430 | master | 11,793 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Query::Variables do
let(:query_string) {%|
query getCheese(
$animals: [DairyAnimal!],
$intDefaultNull: Int = null,
$int: Int,
$intWithDefault: Int = 10)
{
cheese(id: 1) {
similarCheese(source: $animals)
}
}
|}... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/rails/graphql/tracing/active_support_notifications_tracing_spec.rb | Ruby | mit | 5,430 | master | 1,793 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::ActiveSupportNotificationsTracing do
let(:schema) {
Class.new(StarWars::Schema) do
tracer GraphQL::Tracing::ActiveSupportNotificationsTracing
end
}
it "pushes through AS::N" do
traces = []
callback = ->(name, s... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/mongoid/star_trek/data.rb | Ruby | mit | 5,430 | master | 2,821 | # frozen_string_literal: true
require 'ostruct'
require 'support/mongoid_setup'
module StarTrek
names = [
'USS Enterprise',
'USS Excelsior',
'USS Reliant',
'IKS Koraga',
'IKS Kronos One',
'IRW Khazara',
'IRW Praetus',
]
# Set up "Bases" in MongoDB
class Base
include Mongoid::Do... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/mongoid/star_trek/schema.rb | Ruby | mit | 5,430 | master | 10,198 | # frozen_string_literal: true
module StarTrek
# Adapted from graphql-relay-js
# https://github.com/graphql/graphql-relay-js/blob/master/src/__tests__/StarTrekSchema.js
class Ship < GraphQL::Schema::Object
implements GraphQL::Types::Relay::Node
global_id_field :id
field :name, String
# Test cyclic... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/integration/mongoid/graphql/relay/mongo_relation_connection_spec.rb | Ruby | mit | 5,430 | master | 17,641 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Relay::MongoRelationConnection" do
def get_names(result)
ships = result["data"]["federation"]["bases"]["edges"]
ships.map { |e| e["node"]["name"] }
end
def get_residents(ship)
ship["residents"]["edges"].map { |e| e["node"]["name"... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/autoload_spec.rb | Ruby | mit | 5,430 | master | 2,197 | # frozen_string_literal: true
require "spec_helper"
require "open3"
describe GraphQL::Autoload do
module LazyModule
extend GraphQL::Autoload
autoload(:LazyClass, "fixtures/lazy_module/lazy_class")
end
module EagerModule
extend GraphQL::Autoload
autoload(:EagerClass, "fixtures/eager_module/eager... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/query_spec.rb | Ruby | mit | 5,430 | master | 34,875 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Query do
let(:query_string) { %|
query getFlavor($cheeseId: Int!) {
brie: cheese(id: 1) { ...cheeseFields, taste: flavor },
cheese(id: $cheeseId) {
__typename,
id,
...cheeseFields,
... edibleField... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/invalid_null_error_spec.rb | Ruby | mit | 5,430 | master | 210 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::InvalidNullError" do
it "can be inspected" do
assert_equal "GraphQL::InvalidNullError", GraphQL::InvalidNullError.inspect
end
end |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution_error_spec.rb | Ruby | mit | 5,430 | master | 17,020 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::ExecutionError do
let(:result) { Dummy::Schema.execute(query_string) }
describe "when returned from a field" do
let(:query_string) {%|
{
cheese(id: 1) {
id
error1: similarCheese(source: [YAK]) {
... similarCheeseFie... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing_spec.rb | Ruby | mit | 5,430 | master | 1,340 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing do
class DummyTraceable
def initialize(*tracers)
@tracers = tracers
end
include GraphQL::Tracing::Traceable
end
describe "#trace" do
it "delivers the metadata to send_trace, with result and key" do
returne... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/non_null_type_spec.rb | Ruby | mit | 5,430 | master | 1,918 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::NonNullType" do
describe "when a non-null field returns null" do
it "nulls out the parent selection" do
query_string = %|{ cow { name cantBeNullButIs } }|
result = Dummy::Schema.execute(query_string)
assert_equal({"cow" => n... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/current_spec.rb | Ruby | mit | 5,430 | master | 1,754 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Current do
describe "when no query is running" do
it "returns nil for things" do
assert_nil GraphQL::Current.operation_name
assert_nil GraphQL::Current.field
assert_nil GraphQL::Current.dataloader_source_class
end
end
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/rake_task_spec.rb | Ruby | mit | 5,430 | master | 3,098 | # frozen_string_literal: true
require "spec_helper"
rake_task_schema_defn = <<-GRAPHQL
type Query {
allowed(allowed: ID!, excluded: ID!): Int
excluded(excluded: ID!): Boolean
ignored(input: NotOneOf): Float
}
input NotOneOf {
arg: Int,
}
GRAPHQL
RakeTaskSchema = GraphQL::Schema.from_definition(rake_task_sche... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/analysis_spec.rb | Ruby | mit | 5,430 | master | 19,765 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Analysis do
class AstTypeCollector < GraphQL::Analysis::Analyzer
def initialize(query)
super
@types = []
end
def on_enter_operation_definition(node, parent, visitor)
@types << visitor.type_definition
end
def... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/schema_spec.rb | Ruby | mit | 5,430 | master | 22,622 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Schema do
describe "inheritance" do
class DummyFeature1 < GraphQL::Schema::Directive::Feature
end
class DummyFeature2 < GraphQL::Schema::Directive::Feature
end
class Query < GraphQL::Schema::Object
field :some_field, ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader_spec.rb | Ruby | mit | 5,430 | master | 53,181 | # frozen_string_literal: true
require "spec_helper"
require "fiber"
if defined?(Console) && defined?(Async)
Console.logger.disable(Async::Task)
end
describe GraphQL::Dataloader do
class BatchedCallsCounter
def initialize
@count = 0
end
def increment
@count += 1
end
attr_reader :c... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/logger_spec.rb | Ruby | mit | 5,430 | master | 4,103 | # frozen_string_literal: true
require "spec_helper"
describe "Logger" do
describe "Schema.default_logger" do
if defined?(Rails)
it "When Rails is present, returns the Rails logger" do
prev_logger = Rails.logger # might be `nil`
Rails.logger = Object.new
assert_equal Rails.logger, Gr... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/directive_spec.rb | Ruby | mit | 5,430 | master | 9,219 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Directive" do
let(:variables) { {"t" => true, "f" => false} }
let(:result) {
if TESTING_EXEC_NEXT
Dummy::Schema.execute_next(query_string, variables: variables)
else
Dummy::Schema.execute(query_string, variables: variables)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/backtrace_spec.rb | Ruby | mit | 5,430 | master | 12,919 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Backtrace do
class LazyError
def raise_err
raise "Lazy Boom"
end
end
class ErrorAnalyzer < GraphQL::Analysis::Analyzer
def on_enter_operation_definition(node, parent_node, visitor)
if node.name == "raiseError"
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/subscriptions_spec.rb | Ruby | mit | 5,430 | master | 43,122 | # frozen_string_literal: true
require "spec_helper"
class InMemoryBackend
MAX_COMPLEXITY = 5
class Subscriptions < GraphQL::Subscriptions
attr_reader :deliveries, :pushes, :extra, :queries, :events
def initialize(schema:, extra:, **rest)
super
@extra = extra
@queries = {}
# { topic... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/authorization_spec.rb | Ruby | mit | 5,430 | master | 35,126 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Authorization" do
module AuthTest
class Box
attr_reader :value
def initialize(value:)
@value = value
end
end
class BaseArgument < GraphQL::Schema::Argument
def visible?(context)
super && (conte... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/analysis/max_query_complexity_spec.rb | Ruby | mit | 5,430 | master | 6,326 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Analysis::MaxQueryComplexity do
let(:schema) { Class.new(Dummy::Schema) }
let(:query_string) {%|
{
a: cheese(id: 1) { id }
b: cheese(id: 1) { id }
c: cheese(id: 1) { id }
d: cheese(id: 1) { id }
e: cheese(id: 1)... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/analysis/query_complexity_spec.rb | Ruby | mit | 5,430 | master | 25,745 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Analysis::QueryComplexity do
let(:schema) { Class.new(Dummy::Schema) { complexity_cost_calculation_mode(:future) } }
let(:reduce_result) { GraphQL::Analysis.analyze_query(query, [GraphQL::Analysis::QueryComplexity]) }
let(:reduce_multiplex_res... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/analysis/query_depth_spec.rb | Ruby | mit | 5,430 | master | 2,333 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Analysis::QueryDepth do
let(:result) { GraphQL::Analysis.analyze_query(query, [GraphQL::Analysis::QueryDepth]) }
let(:query) { GraphQL::Query.new(Dummy::Schema, query_string, variables: variables) }
let(:variables) { {} }
describe "multiple... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/analysis/field_usage_spec.rb | Ruby | mit | 5,430 | master | 7,553 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Analysis::FieldUsage do
let(:result) { GraphQL::Analysis.analyze_query(query, [GraphQL::Analysis::FieldUsage]).first }
let(:query) { GraphQL::Query.new(Dummy::Schema, query_string, variables: variables) }
let(:variables) { {} }
describe "qu... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/analysis/max_query_depth_spec.rb | Ruby | mit | 5,430 | master | 4,378 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Analysis::MaxQueryDepth do
let(:schema) {
schema = Class.new(Dummy::Schema)
schema.analysis_engine = GraphQL::Analysis::AST
schema
}
let(:query_string) { "
{
cheese(id: 1) {
similarCheese(source: SHEEP) {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/finalize_spec.rb | Ruby | mit | 5,430 | master | 20,012 | # frozen_string_literal: true
require "spec_helper"
class ExecutionFinalizeTest < Minitest::Test
class HashKeyResolver
def initialize(key)
@key = key
end
def call(obj, ctx)
obj[@key]
end
end
RESOLVE_TYPE = ->(abs_type, obj, ctx) { ctx.types.get_type("Test") }
TEST_RESOLVERS = {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/interpreter_spec.rb | Ruby | mit | 5,430 | master | 30,079 | # frozen_string_literal: true
require "spec_helper"
require_relative "../subscriptions_spec"
describe GraphQL::Execution::Interpreter do
module InterpreterTest
class Box
def initialize(value: nil, &block)
@value = value
@block = block
end
def value
if @block
@v... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/input_values_spec.rb | Ruby | mit | 5,430 | master | 5,356 | # frozen_string_literal: true
require "spec_helper"
class ExecutionInputValuesTest < Minitest::Test
class TestSchema < GraphQL::Schema
class TestStatus < GraphQL::Schema::Enum
value :ACTIVE
value :INACTIVE
end
class TestInput < GraphQL::Schema::InputObject
argument :string, String, req... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/lazy_spec.rb | Ruby | mit | 5,430 | master | 6,550 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Execution::Lazy do
include LazyHelpers
before do
LazyHelpers::SumAll.all.clear
end
describe "resolving" do
it "calls value handlers" do
res = run_query('{ int(value: 2, plus: 1) }')
assert_equal 3, res["data"]["int"]
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/multiplex_spec.rb | Ruby | mit | 5,430 | master | 8,656 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Execution::Multiplex do
def multiplex(*a, **kw)
if TESTING_EXEC_NEXT
LazyHelpers::LazySchema.multiplex_next(*a, **kw)
else
LazyHelpers::LazySchema.multiplex(*a, **kw)
end
end
let(:q1) { <<-GRAPHQL
query Q1 {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/instrumentation_spec.rb | Ruby | mit | 5,430 | master | 7,106 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Schema do
describe "instrumentation teardown bug" do
# This instrumenter records that it ran,
# or raises an error if instructed to do so
class InstrumenterError < StandardError
attr_reader :key
def initialize(key)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/next_spec.rb | Ruby | mit | 5,430 | master | 11,683 | # frozen_string_literal: true
require "spec_helper"
describe "Next Execution" do
class NextExecutionSchema < GraphQL::Schema
CLEAN_DATA = [
OpenStruct.new(name: "Legumes", grows_in: ["SPRING", "🌻", "FALL"], species: [OpenStruct.new(name: "Snow Pea")]),
OpenStruct.new(name: "Nightshades", grows_in: [... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/errors_spec.rb | Ruby | mit | 5,430 | master | 9,985 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Execution::Errors" do
class ParentErrorsTestSchema < GraphQL::Schema
class ErrorD < RuntimeError; end
rescue_from(ErrorD) do |err, obj, args, ctx, field|
raise GraphQL::ExecutionError, "ErrorD on #{obj.inspect} at #{field ? "#{fiel... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/breadth_runtime_spec.rb | Ruby | mit | 5,430 | master | 9,350 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Execution::Interpreter for breadth-first execution" do
# A breadth-first interpreter uses the following runtime interface:
# - evaluate_selection(result_key, ast_nodes, selections_result)
# - exit_with_inner_result?
class SimpleBreadthRunti... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/lookahead_spec.rb | Ruby | mit | 5,430 | master | 27,605 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Execution::Lookahead do
module LookaheadTest
DATA = [
OpenStruct.new(name: "Cardinal", is_waterfowl: false, similar_species_names: ["Scarlet Tanager"], genus: OpenStruct.new(latin_name: "Piranga")),
OpenStruct.new(name: "Scarlet Ta... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/lazy/lazy_method_map_spec.rb | Ruby | mit | 5,430 | master | 1,597 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Execution::Lazy::LazyMethodMap do
def self.test_lazy_method_map
it "handles multithreaded access" do
a = Class.new
b = Class.new(a)
c = Class.new(b)
lazy_method_map.set(a, :a)
threads = 1000.times.map do |i|
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/execution/interpreter/arguments_spec.rb | Ruby | mit | 5,430 | master | 1,484 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Execution::Interpreter::Arguments" do
class InterpreterArgsTestSchema < GraphQL::Schema
class SearchParams < GraphQL::Schema::InputObject
argument :query, String, required: false
end
class Query < GraphQL::Schema::Object
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/data_dog_tracing_spec.rb | Ruby | mit | 5,430 | master | 2,821 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::DataDogTracing do
module DataDogTest
class Thing < GraphQL::Schema::Object
field :str, String
def str
"blah"
end
end
class Query < GraphQL::Schema::Object
include GraphQL::Types::Relay::HasNo... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/sentry_trace_spec.rb | Ruby | mit | 5,430 | master | 5,609 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::SentryTrace do
module SentryTraceTest
class BaseObject < GraphQL::Schema::Object
class BaseField < GraphQL::Schema::Field
end
field_class(BaseField)
end
class Thing < BaseObject
def self.authorized?(_o... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/notifications_trace_spec.rb | Ruby | mit | 5,430 | master | 1,911 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::NotificationsTrace do
module NotificationsTraceTest
class Query < GraphQL::Schema::Object
field :int, Integer, null: false
def int
1
end
end
class DummyEngine < GraphQL::Tracing::NotificationsTrace... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/data_dog_trace_spec.rb | Ruby | mit | 5,430 | master | 3,922 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::DataDogTrace do
module DataDogTraceTest
class Box
def initialize(value)
@value = value
end
attr_reader :value
end
class BaseObject < GraphQL::Schema::Object
class BaseField < GraphQL::Schema::... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/active_support_notifications_trace_spec.rb | Ruby | mit | 5,430 | master | 2,450 | # frozen_string_literal: true
require "spec_helper"
if testing_rails?
describe GraphQL::Tracing::ActiveSupportNotificationsTrace do
class AsnSchema < GraphQL::Schema
class ThingSource < GraphQL::Dataloader::Source
def fetch(ids)
ids.map { |id| { name: "Thing #{id}" } }
end
e... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/detailed_trace_spec.rb | Ruby | mit | 5,430 | master | 3,035 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::DetailedTrace do
class SamplerSchema < GraphQL::Schema
class Query < GraphQL::Schema::Object
field :truthy, Boolean, fallback_value: true, resolve_static: true
def self.truthy(ctx); true; end
end
query(Query)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/prometheus_tracing_spec.rb | Ruby | mit | 5,430 | master | 867 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::PrometheusTracing do
module PrometheusTracingTest
class Query < GraphQL::Schema::Object
field :int, Integer, null: false
def int
1
end
end
class Schema < GraphQL::Schema
query Query
end
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/new_relic_tracing_spec.rb | Ruby | mit | 5,430 | master | 3,342 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::NewRelicTracing do
module NewRelicTest
class Thing < GraphQL::Schema::Object
implements GraphQL::Types::Relay::Node
end
class Query < GraphQL::Schema::Object
include GraphQL::Types::Relay::HasNodeField
fiel... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/scout_tracing_spec.rb | Ruby | mit | 5,430 | master | 1,486 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::ScoutTracing do
module ScoutApmTest
class Query < GraphQL::Schema::Object
include GraphQL::Types::Relay::HasNodeField
field :int, Integer, null: false
def int
1
end
end
class ScoutSchemaBase... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/platform_tracing_spec.rb | Ruby | mit | 5,430 | master | 6,218 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::PlatformTracing do
class CustomPlatformTracer < GraphQL::Tracing::PlatformTracing
TRACE = []
self.platform_keys = {
"lex" => "l",
"parse" => "p",
"validate" => "v",
"analyze_query" => "aq",
"analyze_... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/perfetto_trace_spec.rb | Ruby | mit | 5,430 | master | 11,326 | # frozen_string_literal: true
require "spec_helper"
require "open3"
if testing_rails?
describe GraphQL::Tracing::PerfettoTrace do
include PerfettoSnapshot
def trace_includes?(json_str, test_str)
json_str.include?(Base64.encode64(test_str).strip) ||
json_str.include?(test_str)
end
clas... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/appoptics_trace_spec.rb | Ruby | mit | 5,430 | master | 4,542 | # frozen_string_literal: true
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Tests for appoptics_apm tracing
#
# if any of these tests fail, please file an issue at
# https://github.com/appoptics/appoptics-apm-ruby
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/legacy_trace_spec.rb | Ruby | mit | 5,430 | master | 1,978 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::LegacyTrace do
it "calls tracers on a parent schema class" do
custom_tracer = Module.new do
def self.trace(key, data)
if key == "execute_query"
data[:query].context[:tracer_ran] = true
end
yield... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/platform_trace_spec.rb | Ruby | mit | 5,430 | master | 6,963 | # frozen_string_literal: true
require "spec_helper"
require_relative "./appsignal_trace_spec"
require_relative "./statsd_trace_spec"
describe GraphQL::Tracing::PlatformTrace do
module CustomPlatformTrace
include GraphQL::Tracing::PlatformTrace
TRACE = []
{
"lex" => "l",
"parse" => "p",
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/trace_spec.rb | Ruby | mit | 5,430 | master | 3,530 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::Trace do
it "has all its methods in the development cop" do
trace_source = File.read("cop/development/trace_methods_cop.rb")
superable_methods = GraphQL::Tracing::Trace.instance_methods(false).sort
superable_methods_source = s... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/appsignal_trace_spec.rb | Ruby | mit | 5,430 | master | 4,945 | # frozen_string_literal: true
require "spec_helper"
module Appsignal
module_function
def instrument(key, &block)
instrumented << key
yield
end
def instrumented
@instrumented ||= []
end
def current
self
end
def start_event
# pass
end
def finish_event(name, title, body)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/statsd_trace_spec.rb | Ruby | mit | 5,430 | master | 1,284 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::StatsdTracing do
module TraceMockStatsd
class << self
def time(key)
self.timings << key
yield
end
def timing(key, ms)
self.timings << key
end
attr_reader :timings
def clea... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/appoptics_tracing_spec.rb | Ruby | mit | 5,430 | master | 4,500 | # frozen_string_literal: true
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Tests for appoptics_apm tracing
#
# if any of these tests fail, please file an issue at
# https://github.com/appoptics/appoptics-apm-ruby
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/trace_modes_spec.rb | Ruby | mit | 5,430 | master | 11,701 | # frozen_string_literal: true
require "spec_helper"
describe "Trace modes for schemas" do
module TraceModesTest
class ParentSchema < GraphQL::Schema
module GlobalTrace
def execute_query(query:)
query.context[:global_trace] = true
super
end
end
module Special... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/notifications_tracing_spec.rb | Ruby | mit | 5,430 | master | 1,171 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::NotificationsTracing do
module NotificationsTracingTest
class Query < GraphQL::Schema::Object
field :int, Integer, null: false
def int
1
end
end
class Schema < GraphQL::Schema
query Query
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/prometheus_trace_spec.rb | Ruby | mit | 5,430 | master | 942 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::PrometheusTracing do
module PrometheusTraceTest
class Query < GraphQL::Schema::Object
field :int, Integer, null: false
def int
1
end
end
class Schema < GraphQL::Schema
query Query
end
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/new_relic_trace_spec.rb | Ruby | mit | 5,430 | master | 8,877 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::NewRelicTrace do
module NewRelicTraceTest
class EchoSource < GraphQL::Dataloader::Source
def fetch(keys)
keys
end
end
class OtherSource < GraphQL::Dataloader::Source
def fetch(keys)
dataloade... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/statsd_tracing_spec.rb | Ruby | mit | 5,430 | master | 1,323 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::StatsdTracing do
module MockStatsd
class << self
def time(key)
self.timings << key
yield
end
attr_reader :timings
def clear
@timings = []
end
end
end
class StatsdTestSch... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/tracing/scout_trace_spec.rb | Ruby | mit | 5,430 | master | 2,126 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Tracing::ScoutTrace do
module ScoutApmTraceTest
class Query < GraphQL::Schema::Object
include GraphQL::Types::Relay::HasNodeField
field :int, Integer, null: false
def int
1
end
end
class ScoutSchemaB... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.