Skip to content

Commit

Permalink
some API cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fermion committed Jan 3, 2024
1 parent 0a50fb8 commit d0b3d77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
2 changes: 2 additions & 0 deletions app/controllers/graphql_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class GraphqlController < ApplicationController
# but you'll have to authenticate your user separately
# protect_from_forgery with: :null_session

skip_before_action :verify_authenticity_token

def execute
variables = prepare_variables(params[:variables])
query = params[:query]
Expand Down
4 changes: 2 additions & 2 deletions app/graphql/types/query_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def clients

field :assignments, [Types::StaffPlan::AssignmentType], null: false
def assignments
User.first.assignments.all
context[:current_user].assignments.all
end

field :users, [Types::StaffPlan::UserType], null: false
def users
Company.first.users.all
context[:current_user].current_company.users.all
end
end
end
25 changes: 0 additions & 25 deletions app/graphql/types/staff_plan_query_type.rb

This file was deleted.

0 comments on commit d0b3d77

Please sign in to comment.