Created
April 7, 2021 20:59
-
-
Save sauy7/4f1f4c9d8ea64e40d333ff0bbcc88b04 to your computer and use it in GitHub Desktop.
Splitting GraphQL Queries in Rails
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
# app/graphql/queries/namespace.rb | |
module Queries | |
module Namespace | |
extend ActiveSupport::Concern | |
included do | |
field :thing #, ... | |
end | |
def thing | |
# ... | |
end | |
end | |
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
# 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