{"repo":"Shopify/graphql-metrics","free":true,"listed":false,"github":"https://github.com/Shopify/graphql-metrics","clone":"git clone https://github.com/Shopify/graphql-metrics.git","description":"Extract as much much detail as you want from GraphQL queries, served up from your Ruby app and the graphql gem.","language":"Ruby","stars":174,"topics":["graphql"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"GraphQL Metrics Extract as much detail as you want from GraphQL queries, served up from your Ruby app and the graphql gem. Compatible with the graphql-batch gem, to extract batch-loaded fields resolution timings. Be sure to read the CHANGELOG to stay updated on feature additions, breaking changes made to this gem. Installation Add this line to your application's Gemfile: You can require it with in your code as needed with: Or globally in the Gemfile with: And then execute: $ bundle Or install it yourself as: $ gem install graphql-metrics Usage Get started by defining your own Analyzer, inheriting from GraphQL::Metrics::Analyzer . The following analyzer demonstrates a simple way to capture commonly used metrics sourced from key parts of your schema definition, the query document being served, as well as runtime query and resolver timings. In this toy example, all of this data is simply stored on the GraphQL::Query context, under a namespace to avoid collisions with other analyzers etc. What you do with these captured metrics is up to you! NOTE : If any non- graphql-ruby gem-related exceptions occur in your application during query document parsing and validation, runtime metrics for queries (like query duration , etc.) as well as field resolver timings (like resolver timings , lazy resolver timings ) may not be present in the extracted metrics hash, even if you opt to collect them. Define your own analyzer subclass Once defined, you can opt into capturing all metrics seen abov","default_branch":null,"files":null,"tree":[],"storefront":"/r/Shopify","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Shopify/graphql-metrics/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}