we need to add a 'body' field to the submission draft type
in graphql to allow us to store text entry drafts going forward.
Test Plan:
* run the db migration to add body to submission draft:
** bundle exec rake db:migrate:up VERSION=20190801215707
* create an assignment as a teacher
* add a student to that assignment
* run the following in the /graphiql endpoint to locate the
submissions for that assignment
```query MyQuery {
assignment(id: "1") {
submissionsConnection(filter: {states: [unsubmitted, submitted, graded, pending_review]}) {
nodes {
_id
submissionDraft {
body
}
}
}
}
}```
** you should see a submission with a null submission draft
* in the rails console, you will need to add a submission
draft with a body to that submission
** sub = Submission.find(1) // or whatever your submission ID is
** draft = SubmissionDraft.create!(submission: sub,
submission_attempt = sub.attempt + 1)
** draft.body = 'some text'
** draft.save!
** sub.submission_drafts = [draft]
** sub.save!
* run the query in graphql again, and you should see something
like:
```
{
"data": {
"assignment": {
"submissionsConnection": {
"nodes": [
{
"_id": "31",
"submissionDraft": {
"body": "some text"
}
}
]
}
}
}
}
```
fixes COMMS-2263
Change-Id: I62877ac43727f02191c84a98e2609bd8f9987733
Reviewed-on: https://gerrit.instructure.com/203674
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>