Skip to content

Commit

Permalink
app/graphql道半ば
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshinotsuyoshi committed Oct 13, 2024
1 parent b11c303 commit 0f2444b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend/Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target :app do
# check "Gemfile" # File name
check "app/models/**/*.rb"
check "app/controllers/**/*.rb"
check "app/graphql/**/*.rb"
# ignore "lib/templates/*.rb"

# library "pathname" # Standard libraries
Expand Down
3 changes: 2 additions & 1 deletion backend/app/graphql/mutations/signup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def resolve(email_address:)
email_address:, password: SecureRandom.uuid, onboarding_status: :before_verify_email_address
)
end
if user.valid?
# @type var user: User
if user&.valid?
InvitationMailer.invite(user.id).deliver_later
else
errors += user.errors.errors
Expand Down
2 changes: 2 additions & 0 deletions backend/sig/graphql/mutations/base_mutation.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Mutations

private

def context: () -> { request: Request, current_user: User, cookies: ActionDispatch::Cookies }

def current_user: () -> untyped

def request: () -> untyped
Expand Down
1 change: 1 addition & 0 deletions backend/sig/mailers/invitation_mailer.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ class InvitationMailer < ApplicationMailer
@signed_id: untyped

def invite: (untyped user_id) -> untyped
def self.invite: (untyped user_id) -> untyped
end
5 changes: 4 additions & 1 deletion backend/sig/models/request.rbs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Request: untyped
class Request
def user_agent: () -> String
def remote_ip: () -> String
end

0 comments on commit 0f2444b

Please sign in to comment.