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 |
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 Thing < GraphQL::Schema::Object | |
| field :name, String | |
| # One option is to extend this method to rename the returned type. |
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" | |
| gem "graphql-enterprise", source: "https://gems.graphql.pro" | |
| gem "activerecord" | |
| gem "sqlite3" | |
| 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.7" | |
| end | |
| class MySchema < GraphQL::Schema | |
| class GetItems < GraphQL::Schema::Resolver | |
| def resolve | |
| [ |
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.4" | |
| end | |
| class MySchema < GraphQL::Schema | |
| class NestedThingInput < GraphQL::Schema::InputObject | |
| argument :env, String | |
| end |
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.4" | |
| gem "graphql-pro", "1.29.4" | |
| gem "async" | |
| gem "pundit" | |
| end | |
| class ThingPolicy |
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" | |
| gem "sqlite3" | |
| gem "activerecord" | |
| end | |
| # Set up the database for the example | |
| require "active_record" |
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
| # This is a demonstration for using GraphQL-Enterprise's ObjectCache | |
| # along with GraphqlDevise. | |
| # | |
| # The trick is that, by default, GraphqlDevise provides its own query type | |
| # which uses its own BaseField. So, to mix in `GraphQL::Enterprise::ObjectCache::FieldIntegration`, | |
| # you have to make your own BaseField class and include GraphqlDevise's `FieldAuthentication` module, | |
| # then do the "existing schema" setup as described here: | |
| # https://github.com/graphql-devise/graphql_devise/tree/master?tab=readme-ov-file#mounting-operations-in-an-existing-schema | |
| # | |
| require "bundler/inline" |
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.3.16" | |
| gem "graphql-enterprise", "1.5.2", source: "https://gems.graphql.pro" | |
| end | |
| class MySchema < GraphQL::Schema | |
| class MakeInputsRequired < GraphQL::Enterprise::Changeset | |
| release "2024-01-01" |