Skip to content

Generate metrics for requested fields #404

@robrichard

Description

@robrichard

It would be useful to know which parts of the schema are in use on production apps by logging which fields are requested. I'd like to build something similar to what @leebyron describes here: https://youtu.be/5pMDd1t2thc?t=35m30s

I think for a given query and schema, I would want a map of each type that is used in the query and the fields that are requested on that type. What is the best way to go about it?

A few ideas are

  • A way to "wrap" the internals that invoke the resolve method, and keep a tally of each time its called on which types
  • Analyze the AST of the entire query and derive it from this. I don't think the AST is schema aware so you can't map the fields back to their types

What do you recommend?

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