0.0.2 • Published 4 years ago

graphql-analytics v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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

  1. 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
  2. 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
    };
0.0.2

4 years ago

0.0.1

4 years ago