Last active
April 24, 2021 01:32
-
-
Save efueyo/b021e938804f89a56739649ed1a02007 to your computer and use it in GitHub Desktop.
Apollo-Sentry-Context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Transaction } from "@sentry/types" | |
export interface Context { | |
// ... other context fields for your context | |
transaction: Transaction | |
} | |
export async function createContext(): Promise<Context> { { | |
// ... create other context fields | |
const transaction = Sentry.startTransaction({ | |
op: "gql", | |
name: "GraphQLTransaction", // this will be the default name, unless the gql query has a name | |
}) | |
return { transaction }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment