Skip to content

Instantly share code, notes, and snippets.

@sauy7
Created April 7, 2021 20:59
Show Gist options
  • Save sauy7/4f1f4c9d8ea64e40d333ff0bbcc88b04 to your computer and use it in GitHub Desktop.
Save sauy7/4f1f4c9d8ea64e40d333ff0bbcc88b04 to your computer and use it in GitHub Desktop.
Splitting GraphQL Queries in Rails
# app/graphql/queries/namespace.rb
module Queries
module Namespace
extend ActiveSupport::Concern
included do
field :thing #, ...
end
def thing
# ...
end
end
end
# app/graphql/types/query_type.rb
module Types
class QueryType < ApplicationType
include Queries::Namespace
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment