This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql", "1.12.24" | |
gem "graphql-pro", "1.24.15" | |
end | |
class Schema < GraphQL::Schema | |
class Thing < GraphQL::Schema::Object | |
field :name, String, null: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql", "1.12.18" | |
gem "graphql-pro", "1.24.13" | |
gem "graphql-batch" | |
end | |
# Monkey-patch this to avoid deleting keys from multiplex.context | |
# in the ensure block below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql", "2.1.6" | |
end | |
class MySchema < GraphQL::Schema | |
class Query < GraphQL::Schema::Object | |
field :f1, Int | |
field :f2, Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql" | |
end | |
# Here's a pretend DB with three tenants: | |
DATA = { | |
"food_lion" => [ | |
{ id: 1, name: "Mayo" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql" | |
end | |
class Schema < GraphQL::Schema | |
# In your base field class, create a new field extension | |
# and configure your fields to use that one instead of GraphQL-Ruby's default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql" | |
gem "libev_scheduler" | |
end | |
class MySchema < GraphQL::Schema | |
class FetchThings < GraphQL::Dataloader::Source | |
def initialize(starting_at:) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql", "2.0.24" | |
end | |
class MySchema < GraphQL::Schema | |
module CustomIntrospection | |
module HideIntrospectionByContext | |
def visible?(ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This benchmark aims to test GraphQL-Ruby's runtime performance | |
# _except_ for parsing. | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
# Pick a GraphQL version: | |
# gem "graphql", "1.13.19" | |
gem "graphql", "~>2.0" | |
gem "benchmark-ips" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql", path: "./" | |
gem "graphql-enterprise", source: "https://gems.graphql.pro" | |
end | |
class BaseField < GraphQL::Schema::Field | |
include GraphQL::Enterprise::Changeset::FieldIntegration | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
gem "graphql", "1.11.2" | |
end | |
class Schema < GraphQL::Schema | |
class Error < GraphQL::Schema::Object | |
field :message, String, null: false | |
end |