All Projects → sysgears → apollo-logger

sysgears / apollo-logger

Licence: MIT license
Apollo GraphQL Logger

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to apollo-logger

RxApolloClient
RxSwift extensions for Apollo Client
Stars: ✭ 46 (+142.11%)
Mutual labels:  apollo
swifters
Browse Swift users on GitHub
Stars: ✭ 13 (-31.58%)
Mutual labels:  apollo
matnbaz
📚 The source-code for matnbaz.net. A monorepo containing the back-end (NestJS/Prisma/Apollo), front-end (Next.js/Apollo) and some tooling.
Stars: ✭ 481 (+2431.58%)
Mutual labels:  apollo
NASSP
Project Apollo - NASSP
Stars: ✭ 110 (+478.95%)
Mutual labels:  apollo
kerrigan
基于Tornado实现的一套配置中心,可基于分项目、环境管理配置,语法高亮、对比历史版本、快速回滚等,并提供Restful风格的API
Stars: ✭ 57 (+200%)
Mutual labels:  apollo
kernel xiaomi sm8250
CLO Rebased kernel for Xiaomi SM8250 series devices updated to CAF tag LA.UM.9.12.r1-14700-SMxx50 with AOSP android-4.19-stable merged.
Stars: ✭ 111 (+484.21%)
Mutual labels:  apollo
redwood
The App Framework for Startups
Stars: ✭ 15,079 (+79263.16%)
Mutual labels:  apollo
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (+421.05%)
Mutual labels:  apollo
react-apollo-mutation-state
A React HOC wrapper for Apollo GraphQL mutation, provides loading and error in props
Stars: ✭ 16 (-15.79%)
Mutual labels:  apollo
apollo.net
Apollo配置中心.Net客户端
Stars: ✭ 449 (+2263.16%)
Mutual labels:  apollo
Heighliner
A GraphQL Server for NewSpring Web
Stars: ✭ 13 (-31.58%)
Mutual labels:  apollo
jest-gql
✅🚀GraphQL based tests for Jest and Apollo
Stars: ✭ 33 (+73.68%)
Mutual labels:  apollo
graphqlizer
Make your meteor mongo collections accessible over a graphql endpoint
Stars: ✭ 37 (+94.74%)
Mutual labels:  apollo
erxes-widgets-api
Deprecated: Repo is now integrated with erxes-api
Stars: ✭ 22 (+15.79%)
Mutual labels:  apollo
create-full-stack
Set up a TypeScript full stack with one command.
Stars: ✭ 94 (+394.74%)
Mutual labels:  apollo
alda
A boilerplate for React isomorphic aplication with Material Design
Stars: ✭ 16 (-15.79%)
Mutual labels:  apollo
rogue.js
The "nearly invisible" way to server-render React applications
Stars: ✭ 1,914 (+9973.68%)
Mutual labels:  apollo
graphX
A simple blog based on Nuxt and graphQL
Stars: ✭ 19 (+0%)
Mutual labels:  apollo
DiscoveryPlatform
☀️ Nepxion DiscoveryPlatform is a platform for Nepxion Discovery with service governance, release orchestration, flow inspection, instance blacklist, gateway route 服务治理、蓝绿灰度编排、流量侦测、实例摘除、网关路由的平台
Stars: ✭ 63 (+231.58%)
Mutual labels:  apollo
mern-apollo-graphql-boilerplate
MERN + Apollo-Graphql Boilerplate
Stars: ✭ 21 (+10.53%)
Mutual labels:  apollo

Apollo GraphQL Logger

npm version Twitter Follow

Installation

npm install --save-dev apollo-logger

Usage

For full logging you will need to attach Apollo Logger to:

  • Apollo Link
  • Apollo Express Server
  • And PubSub
import { LoggingLink, wrapPubSub, formatResponse } from 'apollo-logger';

const logOptions = { logger: console.log };

const link = ApolloLink.from([
  new LoggingLink(logOptions),
  new HttpLink({uri: ...})
);

...

app.use('/graphql', bodyParser.json(), graphqlExpress({ schema: myGraphQLSchema, formatResponse: formatResponse.bind(logOptions) });

...

const pubsub = wrapPubSub(new PubSub(), logOptions);

Sample output

On each example the result of operation comes after =>

  • Query:
{"data":{"post":{"id":20,"title":"Post title 20","content":"Post content 20","__typename":"Post","comments":[{"id":39,"content":"Comment title 1 for post 20","__typename":"Comment"},{"id":40,"content":"Comment title 2 for post 20","__typename":"Comment"}]}}} <= post({"id":"20"})
  • Mutation:
{"data":{"addCounter":{"amount":21,"__typename":"Counter"}}} <= addCounter({"amount":1})
  • Subscription
subscribe <= onPostUpdated({"endCursor":11})
  • Subscription message:
{"data":{"counterUpdated":{"amount":21,"__typename":"Counter"}}} <= onCounterUpdated
  • Unsubscription
unsubscribe <= onPostUpdated({"endCursor":11})
  • PubSub publish on a server:
pubsub publish [ 'countUpdated',
  { id: 1, created_at: null, updated_at: null, amount: 7 } ]
  • PubSub subscribe on a server:
pubsub subscribe postsUpdated => 2
  • PubSub unsubscribe on a server:
pubsub unsubscribe [ 2 ]
  • PubSub message generated on a server:
pubsub msg postsUpdated({"mutation":"CREATED","id":21,"node":{"id":21,"title":"New post 1"}})

License

Copyright © 2017 SysGears INC. This source code is licensed under the MIT license.

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].