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 France-Allemagne, repensons le rôle de la frontière" questionnaire, finds all the questions, and returns each question's title and the first 5 responses:

{
  node(id: "UXVlc3Rpb25uYWlyZTo0NGNkNzBiYy0zZjE5LTExZTgtYjE2OS0wMjQyYWMxMTAwMDI=") {
    ... 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 France-Allemagne, repensons le rôle de la frontière" questionnaire, finds the first 10 replies, and returns each response's value and question title:

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