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 |
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
import { Client, defaultExchanges, subscriptionExchange } from 'urql' | |
import Pusher from "pusher" | |
const pusherClient = new Pusher("your-app-key", { cluster: "us2" }) | |
const forwardSubscriptionToPusher = (operation) => { | |
// urql will call `.subscribe` on the returned object: | |
// https://github.com/FormidableLabs/urql/blob/f89cfd06d9f14ae9cb3be10b21bd5cbd12ca275c/packages/core/src/exchanges/subscription.ts#L68-L73 | |
// https://github.com/FormidableLabs/urql/blob/f89cfd06d9f14ae9cb3be10b21bd5cbd12ca275c/packages/core/src/exchanges/subscription.ts#L82-L97 | |
return { | |
subscribe: ({next, error, complete}) => { |
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" | |
end | |
# This visitor will inline any fragment definitions in the document. | |
# It assumes that the document is valid; it will :boom: if there are | |
# cycles in the fragment spreads. |
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.13.10" | |
gem "graphql-pro", "1.21.4" | |
gem "graphql-enterprise", "1.1.3" | |
end | |
class CachingSchema < GraphQL::Schema |
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 "graphql-pro" | |
gem "sqlite3" | |
gem "rails" | |
end | |
require "rails/all" | |
require "logger" |
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.13.2" | |
gem "graphql-enterprise", "1.1.0" | |
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.13.1" | |
gem "graphql-pro" | |
end | |
class Schema < GraphQL::Schema | |
class BaseObject < GraphQL::Schema::Object | |
include GraphQL::Pro::PunditIntegration::ObjectIntegration |
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" | |
require "logger" | |
gemfile do | |
gem "graphql", "2.2.10" | |
gem "graphql-pro", "1.26.3" | |
gem "redis" | |
end | |
# In-memory cache: populate the cache after queries are run. |
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.13.0" | |
gem "graphql-pro", "1.20.3" | |
gem "pundit" | |
end | |
require "ostruct" |
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.20" | |
end | |
class PreventNestedCards < GraphQL::Analysis::AST::Analyzer | |
def initialize(query) | |
super | |
@inside_players_selection = false |