Skip to content

Conversation

demeyerthom
Copy link
Member

@demeyerthom demeyerthom commented Sep 9, 2025

This pull request introduces a new "strict" mode for GraphQL fetchers, which leverages the graphql-toe library to improve error handling by throwing errors when attempting to access fields that failed to fetch. In addition, it adds graphql-toe as a new dependency and updates related lock files.

Strict fetcher implementation and dependency updates:

  • Added initStrictServerFetcher to src/server.ts, which wraps the existing server fetcher and uses graphql-toe to enforce strict error handling based on the GraphQL errors array. This ensures that accessing failed fields will throw an error, making error handling more robust.
  • Imported graphql-toe and related types in src/server.ts to support the new strict fetcher. [1] [2]

Dependency management:

  • Added graphql-toe as a dependency in package.json and updated pnpm-lock.yaml to reflect the new package and its version. [1] [2] [3] [4]

Documentation:

  • Added a changeset (.changeset/cuddly-beers-cry.md) documenting the new strict server and client fetchers and their improved error handling.

Copy link

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: cc92fdd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@labdigital/graphql-fetcher Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mvantellingen
Copy link
Member

Cool! Seems some formatting changes where introduced by the change

@demeyerthom demeyerthom marked this pull request as ready for review September 26, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants