Improve arg parsing
This commit is contained in:
@@ -97,7 +97,7 @@ impl PileValue {
|
||||
for s in &query.segments {
|
||||
match s {
|
||||
PathSegment::Root => out = Some(self.clone()),
|
||||
PathSegment::Field(field) => {
|
||||
PathSegment::Field { name, args } => {
|
||||
let e = match out.map(|x| x.object_extractor()) {
|
||||
Some(e) => e,
|
||||
None => {
|
||||
@@ -106,7 +106,7 @@ impl PileValue {
|
||||
}
|
||||
};
|
||||
|
||||
out = e.field(field).await?;
|
||||
out = e.field(name, args.as_deref()).await?;
|
||||
}
|
||||
|
||||
PathSegment::Index(idx) => {
|
||||
@@ -163,7 +163,7 @@ impl PileValue {
|
||||
let keys = e.fields().await?;
|
||||
let mut map = Map::new();
|
||||
for k in &keys {
|
||||
let v = match e.field(k).await? {
|
||||
let v = match e.field(k, None).await? {
|
||||
Some(x) => x,
|
||||
None => continue,
|
||||
};
|
||||
@@ -216,7 +216,7 @@ impl PileValue {
|
||||
let keys = e.fields().await?;
|
||||
let mut map = Map::new();
|
||||
for k in &keys {
|
||||
let v = match e.field(k).await? {
|
||||
let v = match e.field(k, None).await? {
|
||||
Some(x) => x,
|
||||
None => continue,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user