For generated documentation on what objects and fields are available, you can access the GraphQL Docs
tab in the GraphQL Playground, either locally (http://localhost:8081/graphql) or on dev (https://devproposal.facilities.rl.ac.uk/graphql).
Pass in a filter to the proposals query.
{ proposals(filter: { callId: 1}) { proposals { # Proposal[] status } } } |
From the questionary of a proposal, you can get a list of answers for each step (topic).
Note that while the proposal basis (title and abstract), sample, and sub template (generic template) questions are included in this list, their answers are not accessible through the value.
{ proposal(primaryKey: 1) { questionary { steps { fields { # Answer[] question { question # The question title id naturalKey dataType } value # The answer for most question types } } } } } |
The title and abstract answers aren't accessible through the questionary of a proposal, so query them on a proposal.
{ proposal(primaryKey: 1) { title abstract } } |
You can look at the generic templates or sample fields of a proposal, and then get the question data from the questionary.
Note that this will show all generic templates and samples within the proposal (i.e. answers to potentially more than one question). If you use this in combination with Get the questions of a proposal, you can cross reference the naturalKey or id.
{ proposal(primaryKey: 43) { samples { questionary { steps { fields { question { question # The question id naturalKey } value # The answer } } } } genericTemplates { questionary { steps { fields { question { question # The question id naturalKey } value # The answer } } } } } } |
{ proposals(filter: { callId: 1}) { proposals { title abstract questionary { # Excludes sample, proposal basis and sub template answers steps { fields { question { question # The question } value # The answer } } } genericTemplates { questionary { steps { fields { question { id naturalKey question # The question } value # The answer } } } } samples { questionary { steps { fields { question { id naturalKey question # The question } value # The answer } } } } } } } |