Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actual query name inside extensions ResolveInfo #551

Closed
matteosister opened this issue Jun 25, 2021 · 1 comment
Closed

Add actual query name inside extensions ResolveInfo #551

matteosister opened this issue Jun 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@matteosister
Copy link

matteosister commented Jun 25, 2021

Code example

gql query

{
  add_numbers: add(a: 1, b: 2)
}

extension

impl Extension for TracingExtension {
    async fn resolve(
        &self,
        ctx: &ExtensionContext<'_>,
        info: ResolveInfo<'_>,
        next: NextResolve<'_>,
    ) -> ServerResult<Option<Value>> {
        let name = info.path_node.field_name();
        next.run(ctx, info).await
    }
}

Expected Behavior

I should be able to access the query name as "add" AND "add_numbers"

Actual Behavior

I can only access the field_name as "add_numbers"

@matteosister matteosister added the bug Something isn't working label Jun 25, 2021
@sunli829 sunli829 added enhancement New feature or request and removed bug Something isn't working labels Jun 29, 2021
@sunli829
Copy link
Collaborator

Released in v2.9.5

@sunli829 sunli829 closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants