0.0.2 • Published 4 years ago
graphql-analytics v0.0.2
GraphQL Analytics
This library is currently under development.
This library allows for defining analytics events directly in a GraphQL schema. These events can then be reported to a remote analytics service for collection and visualization.
How to Use
In your GraphQL schema, first define the analytics directives:
directive @event (category: String!, action: String!, label: String, labelKey: String, value: Int, valueKey: String) on FIELD_DEFINITION directive @profile (category: String, action: String!, label: String, labelKey: String) on FIELD_DEFINITION directive @exceptions on SCHEMA
Then in code, define the schema directives for your GraphQL engine:
import { EventDirective, ProfileDirective, ExceptionsDirective } from "graphql-analytics" const schemaDirectives = { event: EventDirective, profile: ProfileDirective, exceptions: ExceptionsDirective };