Don't clone field names when recursing down in selection sets
This commit is contained in:
parent
13903d7628
commit
d7e98d955a
2 changed files with 4 additions and 4 deletions
|
@ -27,7 +27,7 @@ pub struct Registry {
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum FieldPath<'a> {
|
pub enum FieldPath<'a> {
|
||||||
Root(SourcePosition),
|
Root(SourcePosition),
|
||||||
Field(String, SourcePosition, &'a FieldPath<'a>),
|
Field(&'a str, SourcePosition, &'a FieldPath<'a>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Query execution engine
|
/// Query execution engine
|
||||||
|
@ -187,7 +187,7 @@ impl<'a, CtxT> Executor<'a, CtxT> {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn sub_executor(
|
pub fn sub_executor(
|
||||||
&self,
|
&self,
|
||||||
field_name: Option<String>,
|
field_name: Option<&'a str>,
|
||||||
location: SourcePosition,
|
location: SourcePosition,
|
||||||
selection_set: Option<&'a [Selection]>,
|
selection_set: Option<&'a [Selection]>,
|
||||||
)
|
)
|
||||||
|
@ -251,7 +251,7 @@ impl<'a> FieldPath<'a> {
|
||||||
FieldPath::Root(_) => (),
|
FieldPath::Root(_) => (),
|
||||||
FieldPath::Field(ref name, _, ref parent) => {
|
FieldPath::Field(ref name, _, ref parent) => {
|
||||||
parent.construct_path(acc);
|
parent.construct_path(acc);
|
||||||
acc.push(name.clone());
|
acc.push((*name).to_owned());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,7 +325,7 @@ fn resolve_selection_set_into<T, CtxT>(
|
||||||
let exec_vars = executor.variables();
|
let exec_vars = executor.variables();
|
||||||
|
|
||||||
let mut sub_exec = executor.sub_executor(
|
let mut sub_exec = executor.sub_executor(
|
||||||
Some(response_name.clone()),
|
Some(response_name),
|
||||||
start_pos.clone(),
|
start_pos.clone(),
|
||||||
f.selection_set.as_ref().map(|v| &v[..]));
|
f.selection_set.as_ref().map(|v| &v[..]));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue