All Projects → hobochild → apollo-link-segment

hobochild / apollo-link-segment

Licence: MIT license
Automatic analytics for Apollo Apps.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to apollo-link-segment

stuyspec.com
🖼 The Stuyvesant Spectator's website, built with React, GraphQL, and Rails.
Stars: ✭ 22 (+22.22%)
Mutual labels:  graphql-client, apollo
Villus
🏎 A tiny and fast GraphQL client for Vue.js
Stars: ✭ 378 (+2000%)
Mutual labels:  graphql-client, apollo
apollo-link-tracer
Trace your apollo queries and mutations with https://github.com/apollographql/apollo-link
Stars: ✭ 20 (+11.11%)
Mutual labels:  apollo, apollo-link
apollo-link-fragment-argument
An Apollo Link to enable to parameterize fragments
Stars: ✭ 35 (+94.44%)
Mutual labels:  apollo, apollo-link
Apollo Link
🔗 Interface for fetching and modifying control flow of GraphQL requests
Stars: ✭ 1,434 (+7866.67%)
Mutual labels:  graphql-client, apollo
Example Storefront
Example Storefront is Reaction Commerce’s headless ecommerce storefront - Next.js, GraphQL, React. Built using Apollo Client and the commerce-focused React UI components provided in the Storefront Component Library (reactioncommerce/reaction-component-library). It connects with Reaction backend with the GraphQL API.
Stars: ✭ 471 (+2516.67%)
Mutual labels:  graphql-client, apollo
Graphql Deduplicator
A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.
Stars: ✭ 258 (+1333.33%)
Mutual labels:  graphql-client, apollo
apollo-link-defer
Interface for creating asynchronous links.
Stars: ✭ 16 (-11.11%)
Mutual labels:  apollo, apollo-link
Apollo Fetch
🐶 Lightweight GraphQL client that supports middleware and afterware
Stars: ✭ 581 (+3127.78%)
Mutual labels:  graphql-client, apollo
Pup
The Ultimate Boilerplate for Products.
Stars: ✭ 563 (+3027.78%)
Mutual labels:  graphql-client, apollo
Plugin Graphql
Vuex ORM persistence plugin to sync the store against a GraphQL API.
Stars: ✭ 215 (+1094.44%)
Mutual labels:  graphql-client, apollo
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (+450%)
Mutual labels:  apollo, apollo-link
create-graphql-app
Cli tool for bootstrapping serverless GraphQL api
Stars: ✭ 28 (+55.56%)
Mutual labels:  apollo
GraphQL-Blueprint
GraphQL Blueprint: a software developer tool for engineers that want to quickly generate React/Express, Apollo and GraphQL boilerplate code using a data modeling interface. Watch your queries, mutations, and schema update in realtime with our code preview feature and finally, export it when you're ready to begin building the rest of your app!
Stars: ✭ 74 (+311.11%)
Mutual labels:  apollo
gitsearch
A searchbar for querying Github users and repositories. Written in React Native and React Native Web. GraphQL and Apollo Client to query Github GraphQL API.
Stars: ✭ 15 (-16.67%)
Mutual labels:  apollo
react-koa-universal
a boilerplate react graphql apollo css-in-js buzzword koa ssr pwa wasm throwaway app 🚮
Stars: ✭ 12 (-33.33%)
Mutual labels:  apollo
react-apollo-graphql
Get rid of decorators and use Apollo GraphQL queries and mutations in the simple and readable way.
Stars: ✭ 16 (-11.11%)
Mutual labels:  apollo
periqles
React form library for Relay and Apollo
Stars: ✭ 124 (+588.89%)
Mutual labels:  apollo
graphql-typed-client
Strongly typed GraphQL client for .NET
Stars: ✭ 16 (-11.11%)
Mutual labels:  graphql-client
elm-graphql
GraphQL made easy in Elm!
Stars: ✭ 56 (+211.11%)
Mutual labels:  graphql-client

apollo-link-segment

Auto analytics for apollo apps

Installing / Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

A quick introduction of the minimal setup you need to get a hello world up & running.

npm install apollo-link-segment

Prerequisites

  • Apollo Link.

Usage

By default the link assumes segment is ready for use at window.analytics.

import apolloSegment from 'apollo-link-segment';

ApolloLink.from([apolloSegment()]);

But you can pass a custom analytics instance to use

const segmentInstance = require('analytics.js-loader')({
  writeKey: YOUR_SEGMENT_WRITE_KEY
});

import apolloSegment from 'apollo-link-segment';

ApolloLink.from([
  apolloSegment({
    analytics: segmentInstance
  })
]);

By default all operation types will be tracked by you can optionally provide a whitelist.

import apolloSegment from 'apollo-link-segment';

ApolloLink.from([
  apolloSegment({
    // only mutations will be tracked
    operationWhitelist: ['mutation']
  })
]);

By default the analytics.track will be called with the operation name as the event name and the operation as the event metadata.

For example the following query:

query GetUser {
  user {
    id
    name
  }
}

Will result in the following analytics.js call:

analytics.track('GetUser', <GraphqlOperationDetails>)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].