lms-api 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas_api/builder.rb +9 -6
- data/lib/canvas_api/js_helpers.rb +6 -2
- data/lib/canvas_api/rb_graphql_helpers.rb +28 -16
- data/lib/canvas_api/templates/constant.erb +2 -2
- data/lib/canvas_api/templates/rb_graphql_field.erb +3 -3
- data/lib/canvas_api/templates/rb_graphql_input_type.erb +14 -0
- data/lib/canvas_api/templates/rb_graphql_mutation.erb +14 -16
- data/lib/canvas_api/templates/rb_graphql_mutation_include.erb +1 -1
- data/lib/canvas_api/templates/rb_graphql_mutations.erb +8 -10
- data/lib/canvas_api/templates/rb_graphql_resolver.erb +14 -16
- data/lib/canvas_api/templates/rb_graphql_root_query.erb +7 -9
- data/lib/canvas_api/templates/rb_graphql_type.erb +14 -0
- data/lib/lms/canvas.rb +3 -1
- data/lib/lms/version.rb +1 -1
- data/lib/tasks/canvas_api.rake +1 -1
- metadata +4 -3
- data/lib/canvas_api/templates/rb_graphql_model.erb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cd1b4b836309477ea61ae5c2f09400e86d1b3e3ae422460c8faa31e70c049cb
|
4
|
+
data.tar.gz: 6798941f1e531beff1e49d6e1821c27047e168a2062060944f6ff7dab6525c15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b848ba5f6001cd556f58efaea3532490d598f9408e16deae40ffbeddd4c6cbba08c98e3f33166c65578e01d9836eeea68fd141cbaef2a50aef72bac81da75e
|
7
|
+
data.tar.gz: 64042bda319f8e32e76e9b51124ef2205bf20b0c4b6e593d204bfaade0cd4e03f18af7e1635eba568eac713ace2cba369c0d81b68a6a2a727e201d17811d1000
|
data/lib/canvas_api/builder.rb
CHANGED
@@ -47,13 +47,13 @@ module CanvasApi
|
|
47
47
|
|
48
48
|
# One file per Canvas graphql resolver
|
49
49
|
canvas_graphql_resolver_renderer = CanvasApi::Render.new("./templates/rb_graphql_resolver.erb", api, resource, resource_api, operation, parameters, nil, nil)
|
50
|
-
canvas_graphql_resolver_renderer.save("#{rb_graphql_app_path}/lib/
|
50
|
+
canvas_graphql_resolver_renderer.save("#{rb_graphql_app_path}/lib/lms_graphql/resolvers/canvas/#{canvas_graphql_resolver_renderer.nickname}.rb")
|
51
51
|
rb_graphql_fields << CanvasApi::Render.new("./templates/rb_graphql_field.erb", api, resource, resource_api, operation, parameters, nil, nil).render
|
52
52
|
else
|
53
53
|
js_graphql_mutations << CanvasApi::Render.new("./templates/js_graphql_mutation.erb", api, resource, resource_api, operation, parameters, nil, nil).render
|
54
54
|
|
55
55
|
rb_graphql_mutation_renderer = CanvasApi::Render.new("./templates/rb_graphql_mutation.erb", api, resource, resource_api, operation, parameters, nil, nil)
|
56
|
-
rb_graphql_mutation_renderer.save("#{rb_graphql_app_path}/lib/
|
56
|
+
rb_graphql_mutation_renderer.save("#{rb_graphql_app_path}/lib/lms_graphql/mutations/canvas/#{rb_graphql_mutation_renderer.nickname}.rb")
|
57
57
|
rb_graphql_mutations << CanvasApi::Render.new("./templates/rb_graphql_mutation_include.erb", api, resource, resource_api, operation, parameters, nil, nil).render
|
58
58
|
end
|
59
59
|
|
@@ -65,8 +65,11 @@ module CanvasApi
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# Generate one file for each Canvas graphql type
|
68
|
-
|
69
|
-
|
68
|
+
canvas_graphql_type_render = CanvasApi::Render.new("./templates/rb_graphql_type.erb", api, resource, nil, nil, nil, nil, model)
|
69
|
+
canvas_graphql_type_render.save("#{rb_graphql_app_path}/lib/lms_graphql/types/canvas/#{model['id'].underscore.singularize}.rb")
|
70
|
+
|
71
|
+
canvas_graphql_input_render = CanvasApi::Render.new("./templates/rb_graphql_input_type.erb", api, resource, nil, nil, nil, nil, model)
|
72
|
+
canvas_graphql_input_render.save("#{rb_graphql_app_path}/lib/lms_graphql/types/canvas/#{model['id'].underscore.singularize}_input.rb")
|
70
73
|
end
|
71
74
|
|
72
75
|
# Generate one file of constants for every LMS API
|
@@ -85,8 +88,8 @@ module CanvasApi
|
|
85
88
|
CanvasApi::Render.new("./templates/js_graphql_mutations.erb", nil, nil, nil, nil, nil, js_graphql_mutations, nil).save("#{server_app_path}/lib/canvas/graphql_mutations.js")
|
86
89
|
|
87
90
|
# GraphQL Ruby
|
88
|
-
CanvasApi::Render.new("./templates/rb_graphql_root_query.erb", nil, nil, nil, nil, nil, rb_graphql_fields, nil).save("#{rb_graphql_app_path}/lib/
|
89
|
-
CanvasApi::Render.new("./templates/rb_graphql_mutations.erb", nil, nil, nil, nil, nil, rb_graphql_mutations, nil).save("#{rb_graphql_app_path}/lib/
|
91
|
+
CanvasApi::Render.new("./templates/rb_graphql_root_query.erb", nil, nil, nil, nil, nil, rb_graphql_fields, nil).save("#{rb_graphql_app_path}/lib/lms_graphql/types/canvas/query_type.rb")
|
92
|
+
CanvasApi::Render.new("./templates/rb_graphql_mutations.erb", nil, nil, nil, nil, nil, rb_graphql_mutations, nil).save("#{rb_graphql_app_path}/lib/lms_graphql/mutations/canvas/mutations.rb")
|
90
93
|
end
|
91
94
|
|
92
95
|
end
|
@@ -20,14 +20,18 @@ module CanvasApi
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def parameters_doc(operation)
|
23
|
+
def parameters_doc(operation, method)
|
24
24
|
if operation["parameters"].present?
|
25
25
|
parameters = operation["parameters"].
|
26
26
|
reject { |p| p["paramType"] == "path" }.
|
27
27
|
map { |p| "#{p['name']}#{p['required'] ? ' (required)' : ''}" }.
|
28
28
|
compact
|
29
29
|
if parameters.present?
|
30
|
-
|
30
|
+
if method == "get"
|
31
|
+
"\n// const query = {\n// #{parameters.join("\n// ")}\n// }"
|
32
|
+
else
|
33
|
+
"\n// const body = {\n// #{parameters.join("\n// ")}\n// }"
|
34
|
+
end
|
31
35
|
else
|
32
36
|
""
|
33
37
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
module CanvasApi
|
2
2
|
module GraphQLHelpers
|
3
3
|
|
4
|
-
def graphql_type(name, property, return_type = false, model = nil)
|
4
|
+
def graphql_type(name, property, return_type = false, model = nil, input_type = false)
|
5
5
|
if property["$ref"]
|
6
|
-
canvas_name(property['$ref'])
|
6
|
+
canvas_name(property['$ref'], input_type)
|
7
7
|
elsif property["allowableValues"]
|
8
8
|
enum_class_name(model, name)
|
9
9
|
else
|
10
10
|
type = property["type"].downcase
|
11
|
+
|
11
12
|
case type
|
13
|
+
when "{success: true}"
|
14
|
+
"String"
|
12
15
|
when "integer", "string", "boolean", "datetime", "number", "date"
|
13
16
|
graphql_primitive(name, type, property["format"])
|
14
17
|
when "void"
|
@@ -22,9 +25,9 @@ module CanvasApi
|
|
22
25
|
elsif property["items"]["$ref"] == "[String]"
|
23
26
|
"[String]"
|
24
27
|
elsif property["items"]["$ref"] == "DateTime" || property["items"]["$ref"] == "Date"
|
25
|
-
"[
|
28
|
+
"[LMSGraphQL::Types::DateTimeType]"
|
26
29
|
elsif property["items"]["$ref"]
|
27
|
-
"[#{canvas_name(property["items"]["$ref"])}]"
|
30
|
+
"[#{canvas_name(property["items"]["$ref"], input_type)}]"
|
28
31
|
else
|
29
32
|
graphql_primitive(name, property["items"]["type"].downcase, property["items"]["format"])
|
30
33
|
end
|
@@ -41,7 +44,7 @@ module CanvasApi
|
|
41
44
|
# HACK There's no TermsOfService object so we return a string
|
42
45
|
"String"
|
43
46
|
elsif return_type
|
44
|
-
canvas_name(property["type"])
|
47
|
+
canvas_name(property["type"], input_type)
|
45
48
|
else
|
46
49
|
puts "Unable to match '#{name}' requested property '#{property}' to GraphQL Type."
|
47
50
|
"String"
|
@@ -50,9 +53,9 @@ module CanvasApi
|
|
50
53
|
end
|
51
54
|
end
|
52
55
|
|
53
|
-
def canvas_name(type)
|
56
|
+
def canvas_name(type, input_type = false)
|
54
57
|
name = type.split('|').first.strip.singularize
|
55
|
-
"
|
58
|
+
"LMSGraphQL::Types::Canvas::Canvas#{name}#{input_type ? 'Input' : ''}"
|
56
59
|
end
|
57
60
|
|
58
61
|
def graphql_primitive(name, type, format)
|
@@ -74,9 +77,9 @@ module CanvasApi
|
|
74
77
|
when "boolean"
|
75
78
|
"Boolean"
|
76
79
|
when "datetime"
|
77
|
-
"
|
80
|
+
"LMSGraphQL::Types::DateTimeType"
|
78
81
|
when "date"
|
79
|
-
"
|
82
|
+
"LMSGraphQL::Types::DateTimeType"
|
80
83
|
else
|
81
84
|
raise "Unable to match requested primitive '#{type}' to GraphQL Type."
|
82
85
|
end
|
@@ -107,7 +110,7 @@ module CanvasApi
|
|
107
110
|
end
|
108
111
|
end
|
109
112
|
|
110
|
-
def graphql_fields(model, resource_name)
|
113
|
+
def graphql_fields(model, resource_name, argument = false)
|
111
114
|
if !model["properties"]
|
112
115
|
puts "NO properties for #{resource_name} !!!!!!!!!!!!!!!!!!!!!"
|
113
116
|
return []
|
@@ -118,9 +121,15 @@ module CanvasApi
|
|
118
121
|
description << "Example: #{safe_rb(property['example'])}".gsub("..", "").gsub("\n", " ") if property["example"].present?
|
119
122
|
|
120
123
|
if type = graphql_type(name, property, false, model)
|
121
|
-
|
124
|
+
if argument
|
125
|
+
<<-CODE
|
126
|
+
argument :#{name.underscore}, #{type}, "#{description}", required: false
|
127
|
+
CODE
|
128
|
+
else
|
129
|
+
<<-CODE
|
122
130
|
field :#{name.underscore}, #{type}, "#{description}", null: true
|
123
|
-
|
131
|
+
CODE
|
132
|
+
end
|
124
133
|
else
|
125
134
|
puts "Unable to determine type for #{name}"
|
126
135
|
end
|
@@ -128,7 +137,7 @@ module CanvasApi
|
|
128
137
|
end
|
129
138
|
|
130
139
|
def type_from_operation(operation)
|
131
|
-
graphql_type("operation", operation, true)
|
140
|
+
type = graphql_type("operation", operation, true)
|
132
141
|
end
|
133
142
|
|
134
143
|
def name_from_operation(operation)
|
@@ -141,7 +150,7 @@ module CanvasApi
|
|
141
150
|
end
|
142
151
|
|
143
152
|
def is_basic_type(type)
|
144
|
-
["Int", "String", "Boolean", "
|
153
|
+
["Int", "String", "Boolean", "LMSGraphQL::Types::DateTimeType", "Float", "ID"].include?(type)
|
145
154
|
end
|
146
155
|
|
147
156
|
def no_brackets(str)
|
@@ -149,7 +158,7 @@ module CanvasApi
|
|
149
158
|
end
|
150
159
|
|
151
160
|
def make_file_name(str)
|
152
|
-
str.underscore.split("/").last.split("|").first.strip.singularize
|
161
|
+
str.underscore.split("/").last.split("|").first.gsub("canvas_", "").strip.singularize
|
153
162
|
end
|
154
163
|
|
155
164
|
def require_from_operation(operation)
|
@@ -182,7 +191,10 @@ module CanvasApi
|
|
182
191
|
end
|
183
192
|
|
184
193
|
def nested_arg(str)
|
185
|
-
|
194
|
+
# TODO/HACK we are replacing values from the string here to get things to work for now.
|
195
|
+
# However, removing these symbols means that the methods that use the arguments
|
196
|
+
# generated herein will have bugs and be unusable.
|
197
|
+
str.gsub("[", "_").gsub("]", "").gsub("*", "star").gsub("<", "_").gsub(">", "_")
|
186
198
|
end
|
187
199
|
|
188
200
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% parameters_doc = parameters_doc(operation) -%>
|
1
|
+
<% parameters_doc = parameters_doc(operation, @method.downcase) -%>
|
2
2
|
// <%=@summary%>
|
3
3
|
// <%=@notes%>
|
4
4
|
//
|
@@ -6,5 +6,5 @@
|
|
6
6
|
// API Url: <%=@api_url%>
|
7
7
|
//
|
8
8
|
// Example:<%=parameters_doc%>
|
9
|
-
// return canvasRequest(<%=@nickname%>, {<%=@args.join(', ')%>}<%= parameters_doc.present? ? ",
|
9
|
+
// return canvasRequest(<%=@nickname%>, {<%=@args.present? ? @args.join(', ') : ""%><%= @method.downcase == "get" && parameters_doc.present? ? ", ...query" : ""%>}<%= @method.downcase != "get" && parameters_doc.present? ? ", body" : ""%>);
|
10
10
|
export const <%=@nickname.camelcase(:lower)%> = { type: '<%=@nickname.upcase%>', method: '<%=@method.downcase%>', key: '<%=reducer_key(@nickname, @args)%>', required: <%=js_args(@args)%> };
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
field :<%= @nickname %>,
|
2
|
+
resolver: LMSGraphQL::Resolvers::Canvas::<%= @nickname.classify %>,
|
3
|
+
description: "<%= @summary %>. <%= @notes.gsub(/\n+/, " ").gsub("//", " ").gsub('"', "'") %>"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative "../canvas_base_input_type"
|
2
|
+
<%= require_from_properties(@model) %>
|
3
|
+
|
4
|
+
module LMSGraphQL
|
5
|
+
module Types
|
6
|
+
module Canvas
|
7
|
+
<%=graphql_field_enums(@model)-%>
|
8
|
+
class Canvas<%=@model['id'].singularize%>Input < BaseInputObject
|
9
|
+
description "<%=@description%>. API Docs: https://canvas.instructure.com/doc/api/<%=@name%>.html"
|
10
|
+
<%=graphql_fields(@model, @resource_name, true).join(" ")%>
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,22 +1,20 @@
|
|
1
1
|
require_relative "../canvas_base_mutation"
|
2
2
|
<%= require_from_operation(operation) -%>
|
3
3
|
|
4
|
-
module
|
5
|
-
module
|
6
|
-
module
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
{
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
).parsed_response
|
19
|
-
end
|
4
|
+
module LMSGraphQL
|
5
|
+
module Mutations
|
6
|
+
module Canvas
|
7
|
+
class <%= @nickname.classify %> < BaseMutation
|
8
|
+
<%= @parameters.map{|p| " argument :#{nested_arg(p["name"])}, #{graphql_type(p["name"], p, false, nil, true)}, required: #{p["required"]}"}.join("\n") %>
|
9
|
+
field :<%= name_from_operation(operation) %>, <%= type_from_operation(operation) %>, null: false
|
10
|
+
def resolve(<%= @parameters.map{|p| "#{nested_arg(p['name'])}#{p['required'] ? ':' : ': nil'}"}.join(", ") %>)
|
11
|
+
context[:canvas_api].call("<%= @nickname.upcase %>").proxy(
|
12
|
+
"<%= @nickname.upcase %>",
|
13
|
+
{
|
14
|
+
<%= @parameters.map{|p| " \"#{p['name']}\": #{nested_arg(p['name'])}"}.join(",\n") -%>
|
15
|
+
},
|
16
|
+
nil,
|
17
|
+
).parsed_response
|
20
18
|
end
|
21
19
|
end
|
22
20
|
end
|
@@ -1 +1 @@
|
|
1
|
-
field :<%= @nickname %>, mutation:
|
1
|
+
field :<%= @nickname %>, mutation: LMSGraphQL::Mutations::Canvas::<%= @nickname.classify %>
|
@@ -1,16 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require_relative "../../utils"
|
2
|
+
require_relative "../../types/canvas_base_type"
|
3
3
|
require_all(File.absolute_path(__FILE__), "../../mutations/canvas/")
|
4
4
|
|
5
|
-
module
|
6
|
-
module
|
7
|
-
module
|
8
|
-
|
9
|
-
|
10
|
-
description "Canvas API mutations"
|
5
|
+
module LMSGraphQL
|
6
|
+
module Mutations
|
7
|
+
module Canvas
|
8
|
+
class MutationType < LMSGraphQL::Types::Canvas::BaseType
|
9
|
+
description "Canvas API mutations"
|
11
10
|
|
12
|
-
|
13
|
-
end
|
11
|
+
<%= @content.join("\n ") %>
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
@@ -1,22 +1,20 @@
|
|
1
1
|
require_relative "../canvas_base_resolver"
|
2
2
|
<%= require_from_operation(operation) -%>
|
3
3
|
|
4
|
-
module
|
5
|
-
module
|
6
|
-
module
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<%= @parameters.map{|p| "
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
{
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
).parsed_response
|
19
|
-
end
|
4
|
+
module LMSGraphQL
|
5
|
+
module Resolvers
|
6
|
+
module Canvas
|
7
|
+
class <%= @nickname.classify %> < CanvasBaseResolver
|
8
|
+
type <%= type_from_operation(operation) %>, null: false
|
9
|
+
<%= @parameters.map{|p| " argument :#{nested_arg(p["name"])}, #{graphql_type(p["name"], p)}, required: #{p["required"]}"}.join("\n") %>
|
10
|
+
def resolve(<%= @parameters.map{|p| "#{nested_arg(p['name'])}#{p['required'] ? ':' : ': nil'}"}.join(", ") %>)
|
11
|
+
context[:canvas_api].call("<%= @nickname.upcase %>").proxy(
|
12
|
+
"<%= @nickname.upcase %>",
|
13
|
+
{
|
14
|
+
<%= @parameters.map{|p| " \"#{p['name']}\": #{nested_arg(p['name'])}"}.join(",\n") -%>
|
15
|
+
},
|
16
|
+
nil,
|
17
|
+
).parsed_response
|
20
18
|
end
|
21
19
|
end
|
22
20
|
end
|
@@ -1,15 +1,13 @@
|
|
1
|
-
require_relative "
|
1
|
+
require_relative "../../utils"
|
2
2
|
require_relative "../canvas_base_type"
|
3
3
|
require_all(File.absolute_path(__FILE__), "../../resolvers/canvas/")
|
4
4
|
|
5
|
-
module
|
6
|
-
module
|
7
|
-
module
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<%= @content.join("\n\n ") %>
|
12
|
-
end
|
5
|
+
module LMSGraphQL
|
6
|
+
module Types
|
7
|
+
module Canvas
|
8
|
+
class QueryType < BaseType
|
9
|
+
description "The root query of Canvas schema"
|
10
|
+
<%= @content.join("\n\n ") %>
|
13
11
|
end
|
14
12
|
end
|
15
13
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative "../canvas_base_type"
|
2
|
+
<%= require_from_properties(@model) %>
|
3
|
+
|
4
|
+
module LMSGraphQL
|
5
|
+
module Types
|
6
|
+
module Canvas
|
7
|
+
<%=graphql_field_enums(@model)-%>
|
8
|
+
class Canvas<%=@model['id'].singularize%> < BaseType
|
9
|
+
description "<%=@description%>. API Docs: https://canvas.instructure.com/doc/api/<%=@name%>.html"
|
10
|
+
<%=graphql_fields(@model, @resource_name).join(" ")%>
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/lms/canvas.rb
CHANGED
@@ -337,7 +337,9 @@ module LMS
|
|
337
337
|
query_parameters << :page
|
338
338
|
query_parameters << :as_user_id
|
339
339
|
|
340
|
-
allowed_params = params.
|
340
|
+
allowed_params = params.
|
341
|
+
slice(*query_parameters).
|
342
|
+
reject { |key, value| value.nil? }
|
341
343
|
|
342
344
|
if allowed_params.present?
|
343
345
|
"#{uri}?#{allowed_params.to_query}"
|
data/lib/lms/version.rb
CHANGED
data/lib/tasks/canvas_api.rake
CHANGED
@@ -13,7 +13,7 @@ namespace :canvas do
|
|
13
13
|
desc "Scrape the LMS api"
|
14
14
|
task :api do
|
15
15
|
current_path = File.expand_path(File.dirname(__FILE__))
|
16
|
-
client_app_path = File.expand_path(File.join(current_path, "../../../atomic-
|
16
|
+
client_app_path = File.expand_path(File.join(current_path, "../../../atomic-canvas/src/constants"))
|
17
17
|
server_app_path = File.expand_path(File.join(current_path, "../../../atomic-lti"))
|
18
18
|
elixir_app_path = File.expand_path(File.join(current_path, "../../../catalyst"))
|
19
19
|
rb_graphql_app_path = File.expand_path(File.join(current_path, "../../../lms_graphql_api"))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lms-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atomic Jolt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-08-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -129,12 +129,13 @@ files:
|
|
129
129
|
- lib/canvas_api/templates/js_url.erb
|
130
130
|
- lib/canvas_api/templates/js_urls.erb
|
131
131
|
- lib/canvas_api/templates/rb_graphql_field.erb
|
132
|
-
- lib/canvas_api/templates/
|
132
|
+
- lib/canvas_api/templates/rb_graphql_input_type.erb
|
133
133
|
- lib/canvas_api/templates/rb_graphql_mutation.erb
|
134
134
|
- lib/canvas_api/templates/rb_graphql_mutation_include.erb
|
135
135
|
- lib/canvas_api/templates/rb_graphql_mutations.erb
|
136
136
|
- lib/canvas_api/templates/rb_graphql_resolver.erb
|
137
137
|
- lib/canvas_api/templates/rb_graphql_root_query.erb
|
138
|
+
- lib/canvas_api/templates/rb_graphql_type.erb
|
138
139
|
- lib/canvas_api/templates/rb_url.erb
|
139
140
|
- lib/canvas_api/templates/rb_urls.erb
|
140
141
|
- lib/lms/canvas.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative "../canvas_base_type"
|
2
|
-
<%= require_from_properties(@model) %>
|
3
|
-
|
4
|
-
module LMS
|
5
|
-
module GraphQL
|
6
|
-
module Types
|
7
|
-
module Canvas
|
8
|
-
<%=graphql_field_enums(@model)-%>
|
9
|
-
class <%=@model['id'].singularize%> < BaseType
|
10
|
-
description "<%=@description%>. API Docs: https://canvas.instructure.com/doc/api/<%=@name%>.html"
|
11
|
-
<%=graphql_fields(@model, @resource_name).join(" ")%>
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|