Start by connecting with our Metrics API or pick one of our off-the-shelf plugins to get going. Use the Logging API to get metrics and insights into your GraphQL usage. Learn more about our Logging API and the server plugins we support.
Install the Node plugin:
1npm install --save wollaston
Then integrate into your project.
1import { createWollastonLoggerPlugin } from 'wollaston/node-server';
2import { startStandaloneServer } from "@graph-server/standalone";
3import { GraphServer } from "@graph-server/core";
4
5const wollastonPlugin = createWollastonLoggerPlugin({
6 serviceName: "orchard-api",
7 token: "wlst_log_5f19c0be47ad2e83b114a6cd39f7205ea48c1d6b9e0742fa8c33ab61d7d2",
8 // a fetch compliant function, can be from 'node-fetch' if you are running
9 // or the global fetch function if running in a v8 environment (e.g. an edge worker)
10 fetch: fetch,
11});
12
13const server = new GraphServer({
14 typeDefs,
15 resolvers,
16 plugins: [wollastonPlugin]
17});
18
19const { url } = await startStandaloneServer(server);
20console.log(`Listening on ${url}`);