I started to use GraphQL for my drupal8 application to expose some data. Now I want to use it to return a webform that I created.

I installed an add-on for webform graphl https://github.com/duartegarin/graphql_webform but am not sure how to use it. I thought it will add a new query type called WebformQueryById but it is not showing up when I navigated to the GraphQL explorer.

I have been stuck for days on this. Is there some configuration / setting steps I might be missing? Thanks


I've got a webform called "test", and the following query works for me:


It returns the following (truncated):

  "data": {
    "webformById": {
      "webform": {
        "elements": [
            "keys": [

I'm not sure what info you're trying to get out of webforms. My impression is that the graphql_webform module is still very much a work in progress, and not particularly useful in its current state.

About the WebformQueryById: that's the name of the class, but there's a declaration before the the class that specifies how to call it:

 * @GraphQLField(
 *   id = "webform_by_id",
 *   type = "WebformResult",
 *   name = "webformById",
 *   nullable = true,
 *   multi = false,
 *   arguments = {
 *     "webform_id" = "String!",
 *   },
 * )

The "name" parameter specifies the name by which to call the query.

  • I am running headless drupal and my goal was to expose the webform via GraphQL so I can rebuild it on the frontend using angular. Is there anything you can suggest to accomplish that? As of right now like you said the module is not particular useful since it is simply returning the keys. Thanks – overloading 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.