We are trying to update a course’s post policies with GraphQL. We managed to create them but are stuck when trying to update existing ones.
This is the use case: The API sets a course’s Post Policy for Grades to manual. To make sure that teachers don’t change it back in the GUI, we check and update the Post Policy to change back to ‘Manually post grades’.
Could anyone help with an example query for updating Post Policies?
Wrote something real quick to do this. Following code uses UCF canvasapi and sgqlc module. Sample code, in case someone wants to use it.
You may need to size this to your needs. I have a small tenant with only 80 something courses and there are no issues.
To set course status ...
endpoint url header mutation_op schema Mutation alias_count
courses account enrollment_term_id course courses course_id course id
query_alias alias_count alias_count alias_count gql_mutate mutation_op schema course_id query_alias
To retrieve data use a query instead of mutation.
You can also request additional fields in your mutation query for error handling, retries, logging etc.