py_gql.tracers#

Collection of useful tracers implementations.

class py_gql.tracers.TimingTracer[source]#

Bases: py_gql.execution.instrumentation.Instrumentation

Default implementation for tracers that collect GraphQL execution timing.

This uses datetime module and all times are collected as UTC.

on_execution_end()[source]#

This will be after operation execution ends and the execution result is ready.

on_execution_start()[source]#

This will be called before operation execution starts.

on_field_end(_root, _ctx, info)[source]#

This will be called after field resolution ends.

Return type:None
on_field_start(_root, _ctx, info)[source]#

This will be called before field resolution starts.

Return type:None
on_parsing_end()[source]#

This will be called after the request document has been parsed.

This is called even if parsing failed due to a syntax error.

on_parsing_start()[source]#

This will be called just before the request document is parsed.

It will not be called when the execution code is provided an already parsed ast.

on_query_end()[source]#

This will be called once the execution result is ready.

on_query_start()[source]#

This will be called at the very start of query processing.

on_validation_end()[source]#

This will be called before query validation.

on_validation_start()[source]#

This will be called before query validation.

class py_gql.tracers.ApolloTracer[source]#

Bases: py_gql.tracers.TimingTracer, py_gql.execution.wrappers.GraphQLExtension

Tracer implementation compatible with the Apollo Tracing specification.

This tracers also implements py_gql.GraphQLExtension in order to be included in the response according to the specification.

payload()[source]#

Return the extension payload.