AnsweredAssumed Answered

How to read and change Course Post Policy of the New Gradebook with GraphQL

Question asked by Jaap Stelpstra on Aug 6, 2019
Latest reply on Dec 18, 2019 by James Jones

Hi,

 

Recently the Grade Posting Policy has been added to the New Gradebook:

https://community.canvaslms.com/docs/DOC-16958-canvas-release-notes-2019-07-13#jive_content_id_Grade_Post_Policies 

 

Currently the default option is Automatically Post Grades, but we want to have all our courses set to Manually Post Grades. We would like to do this using the API and it seems this is possible using the GraphQL API. I have been trying to understand how this works using the following resources:

I'm using Postman to experiment with the GraphQL API and managed to read data. To change the Post Policy of an assignment I came up with the following code:

 

POST {{canvas_url}}/api/graphql

 

GRAPHQL VARIABLES

{
    "canvas_course_id": 26163
}

 

QUERY

mutation ($canvas_course_id: ID!) {
    setCoursePostPolicy(objects: [{
            courseId:$canvas_course_id,
            postManually:true
        }]) {
        errors
        postPolicy
    }
}

I keep on getting the error "Field 'setCoursePostPolicy' is missing required arguments: input" and I don't know why.

 

What do I need to change to make it work?

Outcomes