After @wdransfield 's excellent Canvas Developer Session at INSTCON19 I was inspired to try out GraphQL and see whether we can simplify / speed up our API-based integrations.
We're creating a tool to allow us to quickly assess whether our courses are ready to be published. I'd like to make sure that every module contains a page that starts with "Overview".
I can quite easily pull a list of all modules and the moduleitem IDs for each. It works very well - far easier than combining many API calls.
query MyQuery {<BR /> course(id: 738) {<BR /> name<BR /> modulesConnection {<BR /> nodes {<BR /> moduleItems {<BR /> _id<BR /> }<BR /> name<BR /> }<BR /> }<BR /> }<BR />}If I try to go any further - for example - pull the titles of each Page - the script fails. Attempts to use the "content" attribute fail reliably.
query MyQuery {<BR /> course(id: 738) {<BR /> name<BR /> modulesConnection {<BR /> nodes {<BR /> moduleItems {<BR /> _id<BR /> content {<BR /> ... on Page {<BR /> title<BR /> _id<BR /> }<BR /> }<BR /> }<BR /> name<BR /> }<BR /> }<BR /> }<BR />}<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Message:
Error: Request failed with status code 500
at LYNF.e.exports (https://du11hjcvx0uqb.cloudfront.net/br/dist/webpack-production/main-e-154b446262.js:1693:37)
at Rn+g.e.exports (https://du11hjcvx0uqb.cloudfront.net/br/dist/webpack-production/main-e-154b446262.js:1984:29)
at XMLHttpRequest.h. (https://du11hjcvx0uqb.cloudfront.net/br/dist/webpack-production/main-e-154b446262.js:7382:1)
Is the content attribute not yet production-ready?
Thanks!