Cap Collectif Developers - GraphQL API

Look up responses to a questionnaire

Looking up questionnaires is not yet available on our public API.

But don't worry, we wrote this interactive guide to give you all the information that you need !

Interactive section

The following query looks up the "Questionnaire" questionnaire, finds all the questions, and returns each question's title and the first 5 responses:

{
  node(id: "UXVlc3Rpb25uYWlyZTo4MjIwZjllYy04MjEzLTExZTktODJhZS0wMjQyYWMxMTAwMDU=") {
    ... on Questionnaire {
      questions {
        title
        responses(first: 5, after: null) {
          totalCount
          pageInfo {
            endCursor
            hasNextPage
          }
          edges {
            node {
              ... on ValueResponse {
                value
              }
            }
          }
        }
      }
    }
  }
}

The following query looks up the "Questionnaire" questionnaire, finds the first 10 replies, and returns each response's value and question title:

{
  node(id: "UXVlc3Rpb25uYWlyZTo4MjIwZjllYy04MjEzLTExZTktODJhZS0wMjQyYWMxMTAwMDU=") {
    ... on Questionnaire {
      replies(first: 10, after: null) {
        totalCount
        pageInfo {
            hasNextPage
            endCursor
        }
        edges {
          node {
            id
            createdAt
            publishedAt
            updatedAt
            author {
              id
            }
            responses {
              question {
                title
              }
              ... on ValueResponse {
                value
              }
            }
          }
        }
      }
    }
  }
}