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 "Votre avis sur la place du général de Gaulle à Caudry" questionnaire, finds all the questions, and returns each question's title and the first 5 responses:

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

The following query looks up the "Votre avis sur la place du général de Gaulle à Caudry" questionnaire, finds the first 10 replies, and returns each response's value and question title:

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