Created
March 5, 2023 11:55
-
-
Save Lucas-Barret/cb18f8330eab2d08675c987260854c56 to your computer and use it in GitHub Desktop.
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
module Queries | |
<% if @nested_modules.first.present? %>module <%= @nested_modules.first.camelize %> | |
<% if @nested_modules.second.present? %>module <%= @nested_modules.second.camelize %> | |
class <%= class_name%>Query<% @arguments&.each do |arg| %> | |
argument :<%=arg.split(':').first%>, <%=arg.split(':').second%><% if arg.split(':').second != arg.split(':').last %>, required: true<%end%><%end%> | |
<%if @type.present? %>type Types::<%=@nested_modules.first.camelize%>::<%=@nested_modules.second.camelize%>::<%=@type.split(':').first.camelize%>Type<%if @type.split(':').second != @type.split(':').first%>, null: true<%end%> | |
<% else %>type Types::<%=@nested_modules.first.camelize%>::<%=@nested_modules.second.camelize%>::<%= class_name%> | |
<%end%> | |
def resolve | |
end | |
end | |
end<% else %>class <%= class_name%>Query<% @arguments.each do |arg| %> | |
argument :<%=arg.split(':').first%>, <%=arg.split(':').second%><% if arg.split(':').second != arg.split(':').last %>, required: true<%end%><%end%> | |
type Types::<%=@nested_modules.first.camelize%>::<%=@type.split(':').first%>Type<%if @type.split(':').second != @type.split(':').first%><%=@type.split(':').second%>, null: true<%end%> | |
def resolve | |
end | |
end<%end%> | |
end<%end%> | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment