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 "Lycée Brocéliande - Guer - Formulaire d'analyse" questionnaire, finds all the questions, and returns each question's title and the first 5 responses:

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

The following query looks up the "Lycée Brocéliande - Guer - Formulaire d'analyse" questionnaire, finds the first 10 replies, and returns each response's value and question title:

{
  node(id: "UXVlc3Rpb25uYWlyZTowMDk3ZjQ1OS0zZGE0LTExZWUtYjhhYi0wMjQyYWMxMTAwMDQ=") {
    ... 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
              }
            }
          }
        }
      }
    }
  }
}