Back to Strawberry

Apollo Tracing

docs/extensions/apollo-tracing.md

0.315.3982 B
Original Source

ApolloTracingExtension

This extension adds tracing information to your response for Apollo Engine.

Usage example:

python
import strawberry
from strawberry.extensions.tracing import ApolloTracingExtension


@strawberry.type
class Query:
    @strawberry.field
    def hello(self) -> str:
        return "Hello, world!"


schema = strawberry.Schema(
    Query,
    extensions=[
        ApolloTracingExtension,
    ],
)
<Note>

If you are not running in an Async context then you'll need to use the sync version:

python
import strawberry
from strawberry.extensions.tracing import ApolloTracingExtensionSync


@strawberry.type
class Query:
    @strawberry.field
    def hello(self) -> str:
        return "Hello, world!"


schema = strawberry.Schema(
    Query,
    extensions=[
        ApolloTracingExtensionSync,
    ],
)
</Note>

API reference:

No arguments