Skip to content

Pagination example error: Buffer is not defined #1074

Closed
@alejalapeno

Description

@alejalapeno

Description

The output/returned response for the last pagination query example returns an error of "Buffer is not defined"

Steps to Reproduce

https://graphql.org/learn/pagination/#complete-connection-model
View the output of the example in the Compllete Connection Model section in your browser.

Expected Result

A non-errored GraphQL response

Actual Result

{
  "errors": [
    {
      "message": "Buffer is not defined",
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "path": [
        "hero",
        "friendsConnection"
      ]
    }
  ],
  "data": {
    "hero": null
  }
}

Additional Context

I've previously seen this error in other projects when Webpack was updated to a version that no longer automatically included Node's Buffer polyfill for the browser. The fix in those instances was adding it manually through the plugins option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions