Skip to content

Add client directive support in GraphQLQueryRequestOptions#938

Draft
jiholee17 wants to merge 2 commits intomasterfrom
feature/client-field-directives
Draft

Add client directive support in GraphQLQueryRequestOptions#938
jiholee17 wants to merge 2 commits intomasterfrom
feature/client-field-directives

Conversation

@jiholee17
Copy link
Copy Markdown
Collaborator

Adds operationFieldDirectives parameter to GraphQLQueryRequestOptions to allow passing graphql.language.Directive directives to be applied to the top-level operation field in the serialized query.

Refactors this PR #935 and requires a bit more verbose setup to build a Directive on the user side but leverages the existing Directive type instead of creating a new one, and adds it to the options field to avoid adding a parameter to GraphQLQueryRequest and for extensibility.

Open to feedback on if we want to keep the simplified Directive class from the original PR and let the user pass in that type so they don't have to construct a graphql.language.Directive like

val idempotent =
            Directive
                .newDirective()
                .name("idempotent")
                .arguments(listOf(Argument("key", StringValue.of("abc-123"))))
                .build()

@jiholee17 jiholee17 force-pushed the feature/client-field-directives branch from 485f9bd to a6d1102 Compare April 23, 2026 21:33
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.

1 participant