This file contains hidden or 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.5.7" | |
end | |
class MySchema < GraphQL::Schema | |
class BaseArgument < GraphQL::Schema::Argument | |
def initialize(*args, authenticate_with: nil, **kwargs, &block) | |
@authenticate_with = authenticate_with |
This file contains hidden or 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.5.6" | |
gem "uri" | |
end | |
class MySchema < GraphQL::Schema | |
class Uri < GraphQL::Schema::Scalar | |
def self.coerce_input(value, ctx) |
This file contains hidden or 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.5.0" | |
gem "activerecord", require: "active_record" | |
gem "sqlite3" | |
gem "logger" | |
end | |
# Set up the database for the example |
This file contains hidden or 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.4.15" | |
gem "search_object_graphql", "1.0.5" | |
gem "activerecord", require: "active_record" | |
gem "sqlite3" | |
end | |
require 'search_object' | |
require 'search_object/plugin/graphql' |
This file contains hidden or 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.4.12" | |
end | |
# This example shows three ways of showing a query's complexity to clients. | |
# All three cases require a customized analyzer which adds the value to be used later. | |
class MySchema < GraphQL::Schema | |
class MaxComplexityWithReport < GraphQL::Analysis::MaxQueryComplexity |
This file contains hidden or 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 "diffy", "3.4.3" | |
gem "graphql", "2.4.11" | |
gem "graphql-enterprise", "1.5.6", source: "https://gems.graphql.pro" | |
end | |
# dummy data | |
THINGS = [{name: "Airplane"}, {name: "Bagel"}, {name: "Calendar"}, {name: "Daffodil"}] |
This file contains hidden or 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.4.8", source: "https://rubygems.org" | |
gem "graphql-enterprise", source: "https://gems.graphql.pro" | |
end | |
class MySchema < GraphQL::Schema | |
class SwitchFields < GraphQL::Enterprise::Changeset | |
release "2025-02-01" |
This file contains hidden or 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.4.8" | |
end | |
class MySchema < GraphQL::Schema | |
class Vegetable < GraphQL::Schema::Enum | |
value :ZUCCHINI | |
value :ARTICHOKE |
This file contains hidden or 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.4.8" | |
end | |
THINGS = [ | |
{ name: "Camcorder" }, | |
{ name: "Magnifying Glass" }, | |
{ name: "Disappearing Ink" }, |
This file contains hidden or 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.4.7" | |
end | |
class MySchema < GraphQL::Schema | |
class BaseEdge < GraphQL::Types::Relay::BaseEdge | |
node_nullable(false) | |
end |
NewerOlder