Skip to content

global subscription context config option#4237

Merged
StevenACoffman merged 1 commit into
masterfrom
response_generated_context
Jun 22, 2026
Merged

global subscription context config option#4237
StevenACoffman merged 1 commit into
masterfrom
response_generated_context

Conversation

@StevenACoffman

@StevenACoffman StevenACoffman commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Add global subscription_context_field config option

This is PR for #3863 and is a follow-up to #4230

After #4230, @michelepra revised PR #4191 and added a PR comment that suggested that now the PR should be rebased on top of the implementation merged in #4230

However, that branch hadn't actually been rebased, but instead the latest master had been merged into that branch, and then it appeared that an AI assistant had reconciled any conflicts and made a few other changes. However, the branch had a few problems, and still added more logic and complexity to the templates.

Instead of keeping a separate runtime/codegen path for subscription_context_field, the global config option can > be implemented as a thin opt-in layer over the same logic introduced by #4230:

• @subscriptionContext remains the field-level opt-in.
• subscription_context_field: true enables the same behavior globally for all subscription fields in the analyzed > schema.
• Generated resolvers use the same graphql.Event[T] API introduced by #4230.
• The runtime continues to use the same ResolveFieldStreamWithEventContext, ExecWithEventContext, and subscription response handling already merged upstream.

Signed-off-by: Steve Coffman steve@khanacademy.org

Signed-off-by: Steve Coffman <steve@khanacademy.org>

# Conflicts:
#	codegen/field.go
#	codegen/internal!.gotpl
#	codegen/object.go
#	docs/content/reference/subscription-context.md
#	graphql/event.go
#	graphql/event_test.go
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 0.0%. remained the same — response_generated_context into master

@StevenACoffman StevenACoffman requested a review from UnAfraid June 22, 2026 21:41
@StevenACoffman StevenACoffman merged commit fc9ba19 into master Jun 22, 2026
18 checks passed
@StevenACoffman StevenACoffman deleted the response_generated_context branch June 22, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants