close
Skip to content

add graphql "harness" abstraction along with async parse/validate support#4562

Merged
yaacovCR merged 1 commit intographql:nextfrom
yaacovCR:harness
Feb 17, 2026
Merged

add graphql "harness" abstraction along with async parse/validate support#4562
yaacovCR merged 1 commit intographql:nextfrom
yaacovCR:harness

Conversation

@yaacovCR
Copy link
Copy Markdown
Contributor

@yaacovCR yaacovCR commented Feb 16, 2026

Updated description:

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by Envelop.

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the GraphQLParseFn, GraphQLValidateFn, GraphQLExecuteFn and GraphQLSubscribeFn shapes which make up the harness include purposeful maybe-async return types, even though our internal parse and validate functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the parse result in a promise. the pattern introduced by Envelop. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

@yaacovCR yaacovCR requested a review from a team as a code owner February 16, 2026 15:01
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 16, 2026

@yaacovCR is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@yaacovCR yaacovCR added the PR: feature 🚀 requires increase of "minor" version number label Feb 16, 2026
@yaacovCR yaacovCR force-pushed the harness branch 2 times, most recently from d3809f8 to bec9c58 Compare February 17, 2026 08:36
…port

see graphql#3421

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
@yaacovCR yaacovCR merged commit 735f0e4 into graphql:next Feb 17, 2026
15 of 16 checks passed
@yaacovCR yaacovCR deleted the harness branch February 17, 2026 09:03
yaacovCR added a commit that referenced this pull request Feb 22, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 22, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 23, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 23, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 24, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 24, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 24, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
yaacovCR added a commit that referenced this pull request Feb 24, 2026
…port (#4562)

This PR extends the functionality of the graphql function by allowing users to pass in a custom harness with user-supplied parse/validate/execute/subscribe functions. This allows users to pass custom versions of those functions, enabling a simple API for adding pre/post hooks, a very simplified version of the pattern introduced by [Envelop](https://the-guild.dev/graphql/envelop).

Although this extends what is possible with the graphql function, which is neat, the underlying purpose is not to compete with Envelop and other frameworks, but rather to facilitate them, background at #3421.

The introduction of the `GraphQLParseFn`, `GraphQLValidateFn`, `GraphQLExecuteFn` and `GraphQLSubscribeFn` types for the functions which make up the harness include purposeful maybe-async return types, even though our internal
`parse` and `validate` functions are always sync, to encourage servers and other tooling to expect that user-supplied versions of these functions may have async pre/post hooks.

This is a softened response to the request by Envelop maintainers in #3421 to wrap the `parse` result in a promise. This PR nudges servers and other tooling in that direction by exposing types that return maybe-async results, but is a non-breaking change.

Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature 🚀 requires increase of "minor" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant