graphql: fix global ids in upgraded types

closes RECNVS-505

Test plan:
  querying for the id of any object should return an opaque identifier
  (it should different from that object's _id)

Change-Id: I738fa631915135df03e7e381f0a41d92a7813e06
Reviewed-on: https://gerrit.instructure.com/155688
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:
Cameron Matheson 2018-06-27 11:50:47 -06:00
parent 351a0f4134
commit fdcc1f2aab
6 changed files with 5 additions and 13 deletions

View File

@ -65,6 +65,7 @@ module Types
Assignment::ALLOWED_GRADING_TYPES.each { |type| value(type) }
end
global_id_field :id
field :_id, ID, "legacy canvas id", null: false, method: :id
field :name, String, null: true

View File

@ -23,9 +23,7 @@ module Types
implements GraphQL::Relay::Node.interface
implements Interfaces::TimestampInterface
## TODO: something like this
#implements Interfaces::LegacyNode
global_id_field :id
field :_id, ID, "legacy canvas id", null: false, method: :id
end
end

View File

@ -24,6 +24,7 @@ module Types
implements GraphQL::Relay::Node.interface
implements Interfaces::TimestampInterface
global_id_field :id
field :_id, ID, "legacy canvas id", method: :id, null: false
end
end

View File

@ -26,6 +26,7 @@ module Types
alias :submission :object
# not doing a legacy canvas id since they aren't used in the rest api
global_id_field :id
field :assignment, AssignmentType, null: true
def assignment

View File

@ -30,6 +30,7 @@ module Types
implements GraphQL::Relay::Node.interface
implements Interfaces::TimestampInterface
global_id_field :id
field :_id, ID, "legacy canvas id", null: false, method: :id
field :name, String, null: true

View File

@ -29,8 +29,6 @@ type Assignment implements Node & Timestamped {
dueAt: DateTime
gradingType: GradingType
htmlUrl: URL
# ID of the object.
id: ID!
lockAt: DateTime
lockInfo: LockInfo
@ -366,8 +364,6 @@ type Discussion implements Node & Timestamped {
# legacy canvas id
_id: ID!
createdAt: DateTime
# ID of the object.
id: ID!
updatedAt: DateTime
}
@ -643,8 +639,6 @@ type Quiz implements Node & Timestamped {
# legacy canvas id
_id: ID!
createdAt: DateTime
# ID of the object.
id: ID!
updatedAt: DateTime
}
@ -701,8 +695,6 @@ type Submission implements Node & Timestamped {
grade: String
gradedAt: DateTime
gradingStatus: String
# ID of the object.
id: ID!
score: Float
state: SubmissionState!
@ -794,8 +786,6 @@ type User implements Node & Timestamped {
# only return enrollments for this course
courseId: ID
): [Enrollment!]!
# ID of the object.
id: ID!
name: String