1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
mod tracing;
use crate::context::QueryPathNode;
pub use tracing::ApolloTracing;
pub(crate) type BoxExtension = Box<dyn Extension>;
pub struct ResolveInfo<'a> {
pub resolve_id: usize,
pub path_node: &'a QueryPathNode<'a>,
pub parent_type: &'a str,
pub return_type: &'a str,
}
#[allow(unused_variables)]
pub trait Extension: Sync + Send + 'static {
fn name(&self) -> &'static str;
fn parse_start(&self, query_source: &str) {}
fn parse_end(&self) {}
fn validation_start(&self) {}
fn validation_end(&self) {}
fn execution_start(&self) {}
fn execution_end(&self) {}
fn resolve_field_start(&self, info: &ResolveInfo<'_>) {}
fn resolve_field_end(&self, resolve_id: usize) {}
fn result(&self) -> Option<serde_json::Value>;
}