instructure/canvas-lms · error · GraphQL::ExecutionError
'sticker' is required. Provide a value of null to remove a…
Error message
'sticker' is required. Provide a value of null to remove a sticker
What it means
UpdateSubmissionSticker mutation requires the sticker argument key to be present in the input, even when removing a sticker (value must be explicitly null). Because the argument is declared required: false, GraphQL omits absent keys, so the mutation checks input.key?(:sticker) and raises when the key is missing entirely.
Solutions
- Always pass sticker explicitly, sending null to remove it
- Ensure your HTTP client does not drop null-valued variables
- Add sticker: null in the mutation variables object
- Default the UI to send the current sticker value when unchanged
Example fix
// before
updateSubmissionSticker(input: {assignmentId, anonymousId}) // key omitted
// after
updateSubmissionSticker(input: {assignmentId, anonymousId, sticker: null}) // removes sticker Defensive patterns
Strategy: validation
Validate before calling
const vars = {assignmentId, anonymousId}; if (!('sticker' in vars)) vars.sticker = currentSticker ?? null; Try / catch
try { await gql(updateSubmissionStickerMutation, vars) } catch (e) { if (/sticker' is required/.test(e.message)) vars.sticker = null; else throw e } // then retry Prevention
- Always include the sticker key explicitly, null to remove
- Configure your fetch layer to serialize null variables
- Add a client-side required-key check before sending
When it happens
Trigger: Calling updateSubmissionSticker without passing sticker at all, intending to remove a sticker but sending no field, or a client that strips null values from the variables payload.
Common situations: Client serialization (e.g. omitting undefined/null in JSON bodies); developer assumes absence equals removal; older client versions predating the sticker field.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- You must provide targetGroupId or targetContextId and…
- A maximum of 50 assessees can be provided at once
- A maximum of 50 assessors can be provided at once
- All ConversationMessages must exist within the same…
- Anonymous assignments must be manually posted
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/831915601b50a700.
Report an issue: GitHub.
Appendix: source
Thrown at app/graphql/mutations/update_submission_sticker.rb:29
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
class Mutations::UpdateSubmissionSticker < Mutations::BaseMutation
argument :anonymous_id, ID, required: true
argument :assignment_id, ID, required: true
argument :sticker, Types::StickerType, required: false
field :submission, Types::SubmissionType, null: false
def resolve(input:)
# Ideally we would use required: :nullable above for sticker, but it doesn't seem to work...
raise GraphQL::ExecutionError, "'sticker' is required. Provide a value of null to remove a sticker" unless input.key?(:sticker)
submission = Submission.find_by(
root_account: context[:domain_root_account],
assignment_id: input.fetch(:assignment_id),
anonymous_id: input.fetch(:anonymous_id)
)
raise GraphQL::ExecutionError, "not found" if submission.nil? || !submission.grants_right?(current_user, :grade)
raise GraphQL::ExecutionError, "Stickers feature flag must be enabled" unless submission.course.feature_enabled?(:submission_stickers)
if submission.update(sticker: input.fetch(:sticker))
{ submission: }
else
errors_for(submission)
end
end
end
View on GitHub (pinned to 1c9f0bb801)