add graphql inflection
Change-Id: I75c2e3431a93cde1e707510455aca1fc2ac98e2b Reviewed-on: https://gerrit.instructure.com/117046 Tested-by: Jenkins Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com> QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com> Product-Review: Cameron Matheson <cameron@instructure.com>
This commit is contained in:
parent
7fc13af54e
commit
f389c95e1d
|
@ -1,4 +1,4 @@
|
|||
class GraphqlController < ApplicationController
|
||||
class GraphQLController < ApplicationController
|
||||
include Api::V1
|
||||
|
||||
before_action :require_user, except: :execute
|
||||
|
|
|
@ -13,7 +13,7 @@ CanvasSchema = GraphQL::Schema.define do
|
|||
object_from_id ->(relay_id, ctx) {
|
||||
type, id = GraphQL::Schema::UniqueWithinType.decode(relay_id)
|
||||
|
||||
GqlNodeLoader.load(type, id, ctx)
|
||||
GraphQLNodeLoader.load(type, id, ctx)
|
||||
}
|
||||
|
||||
resolve_type ->(obj, ctx) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module GqlNodeLoader
|
||||
module GraphQLNodeLoader
|
||||
def self.load(type, id, ctx)
|
||||
check_read_permission = make_permission_check(ctx, :read)
|
||||
|
|
@ -9,7 +9,7 @@ module Types
|
|||
argument :_id, !types.ID
|
||||
argument :type, !LegacyNodeType
|
||||
resolve ->(_, args, ctx) {
|
||||
GqlNodeLoader.load(args[:type], args[:_id], ctx)
|
||||
GraphQLNodeLoader.load(args[:type], args[:_id], ctx)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -20,4 +20,5 @@
|
|||
ActiveSupport::Inflector.inflections do |inflect|
|
||||
inflect.singular /(criteri)a$/i, '\1on'
|
||||
inflect.plural /(criteri)on$/i, '\1a'
|
||||
inflect.acronym "GraphQL"
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
||||
|
||||
describe GraphqlController do
|
||||
describe GraphQLController do
|
||||
before :once do
|
||||
student_in_course
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue