X Tutup
Skip to content

There is no way easily get the runtime directives of an operation #4295

@bbakerman

Description

@bbakerman

Today the DataFetchingEnvironment has access to graphql.execution.directives.QueryAppliedDirective for the directives on fields.

We don't have the same for directives on operations.

query q @timeout(ms : 23445) {
   f
}

To get this operation directives one must parse raw AST of graphql.language.OperationDefinition and the raw graphql.language.Directive within

We should have a way to get this during execution

  • graphql.execution.ExecutionContext should have access to a list of "operation level" QueryAppliedDirective s
  • graphql.normalized.ExecutableNormalizedOperation should have access to the same list

I dont think its a stretch in naming to say that QueryAppliedDirective is applicable to operations - eg Query is a quasi synnonym for an mutation operation and subscription opperation anyway

And we dont burn yet another type name by introducing MutationAppliedDirective and SubscriptionAppliedDirective which are all the same thing say. Ideally it would be ExecutableOperationAppliedDirective but that ship has sailed probably (maybe we introduce it UNDER QueryAppliedDirective)

?

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

      X Tutup