apollo-federation 2.15.0

Apollo Federation
Documentation
---
source: apollo-federation/src/connectors/json_selection/parser.rs
expression: "JSONSelection::parse(r#\"\n            # Equivalent to id: $this.id\n            $this { id }\n\n            $args {\n                __typename: $(\"Args\")\n\n                # Using $. instead of just . prevents .input from\n                # parsing as a key applied to the $(\"Args\") string.\n                $.input { title body }\n\n                extra\n            }\n\n            from: $.from\n        \"#)"
---
Ok(
    JSONSelection {
        inner: Named(
            SubSelection {
                selections: [
                    NamedSelection {
                        prefix: Spread(
                            None,
                        ),
                        path: WithRange {
                            node: Path(
                                PathSelection {
                                    path: WithRange {
                                        node: Var(
                                            WithRange {
                                                node: $this,
                                                range: Some(
                                                    54..59,
                                                ),
                                            },
                                            WithRange {
                                                node: Selection(
                                                    SubSelection {
                                                        selections: [
                                                            NamedSelection {
                                                                prefix: None,
                                                                path: WithRange {
                                                                    node: Path(
                                                                        PathSelection {
                                                                            path: WithRange {
                                                                                node: Key(
                                                                                    WithRange {
                                                                                        node: Field(
                                                                                            "id",
                                                                                        ),
                                                                                        range: Some(
                                                                                            62..64,
                                                                                        ),
                                                                                    },
                                                                                    WithRange {
                                                                                        node: Empty,
                                                                                        range: Some(
                                                                                            64..64,
                                                                                        ),
                                                                                    },
                                                                                ),
                                                                                range: Some(
                                                                                    62..64,
                                                                                ),
                                                                            },
                                                                        },
                                                                    ),
                                                                    range: Some(
                                                                        62..64,
                                                                    ),
                                                                },
                                                            },
                                                        ],
                                                        range: Some(
                                                            60..66,
                                                        ),
                                                    },
                                                ),
                                                range: Some(
                                                    60..66,
                                                ),
                                            },
                                        ),
                                        range: Some(
                                            54..66,
                                        ),
                                    },
                                },
                            ),
                            range: Some(
                                54..66,
                            ),
                        },
                    },
                    NamedSelection {
                        prefix: Spread(
                            None,
                        ),
                        path: WithRange {
                            node: Path(
                                PathSelection {
                                    path: WithRange {
                                        node: Var(
                                            WithRange {
                                                node: $args,
                                                range: Some(
                                                    80..85,
                                                ),
                                            },
                                            WithRange {
                                                node: Selection(
                                                    SubSelection {
                                                        selections: [
                                                            NamedSelection {
                                                                prefix: Alias(
                                                                    Alias {
                                                                        name: WithRange {
                                                                            node: Field(
                                                                                "__typename",
                                                                            ),
                                                                            range: Some(
                                                                                104..114,
                                                                            ),
                                                                        },
                                                                        range: Some(
                                                                            104..115,
                                                                        ),
                                                                    },
                                                                ),
                                                                path: WithRange {
                                                                    node: Path(
                                                                        PathSelection {
                                                                            path: WithRange {
                                                                                node: Expr(
                                                                                    WithRange {
                                                                                        node: String(
                                                                                            "Args",
                                                                                        ),
                                                                                        range: Some(
                                                                                            118..124,
                                                                                        ),
                                                                                    },
                                                                                    WithRange {
                                                                                        node: Empty,
                                                                                        range: Some(
                                                                                            125..125,
                                                                                        ),
                                                                                    },
                                                                                ),
                                                                                range: Some(
                                                                                    116..125,
                                                                                ),
                                                                            },
                                                                        },
                                                                    ),
                                                                    range: Some(
                                                                        116..125,
                                                                    ),
                                                                },
                                                            },
                                                            NamedSelection {
                                                                prefix: Spread(
                                                                    None,
                                                                ),
                                                                path: WithRange {
                                                                    node: Path(
                                                                        PathSelection {
                                                                            path: WithRange {
                                                                                node: Var(
                                                                                    WithRange {
                                                                                        node: $,
                                                                                        range: Some(
                                                                                            277..278,
                                                                                        ),
                                                                                    },
                                                                                    WithRange {
                                                                                        node: Key(
                                                                                            WithRange {
                                                                                                node: Field(
                                                                                                    "input",
                                                                                                ),
                                                                                                range: Some(
                                                                                                    279..284,
                                                                                                ),
                                                                                            },
                                                                                            WithRange {
                                                                                                node: Selection(
                                                                                                    SubSelection {
                                                                                                        selections: [
                                                                                                            NamedSelection {
                                                                                                                prefix: None,
                                                                                                                path: WithRange {
                                                                                                                    node: Path(
                                                                                                                        PathSelection {
                                                                                                                            path: WithRange {
                                                                                                                                node: Key(
                                                                                                                                    WithRange {
                                                                                                                                        node: Field(
                                                                                                                                            "title",
                                                                                                                                        ),
                                                                                                                                        range: Some(
                                                                                                                                            287..292,
                                                                                                                                        ),
                                                                                                                                    },
                                                                                                                                    WithRange {
                                                                                                                                        node: Empty,
                                                                                                                                        range: Some(
                                                                                                                                            292..292,
                                                                                                                                        ),
                                                                                                                                    },
                                                                                                                                ),
                                                                                                                                range: Some(
                                                                                                                                    287..292,
                                                                                                                                ),
                                                                                                                            },
                                                                                                                        },
                                                                                                                    ),
                                                                                                                    range: Some(
                                                                                                                        287..292,
                                                                                                                    ),
                                                                                                                },
                                                                                                            },
                                                                                                            NamedSelection {
                                                                                                                prefix: None,
                                                                                                                path: WithRange {
                                                                                                                    node: Path(
                                                                                                                        PathSelection {
                                                                                                                            path: WithRange {
                                                                                                                                node: Key(
                                                                                                                                    WithRange {
                                                                                                                                        node: Field(
                                                                                                                                            "body",
                                                                                                                                        ),
                                                                                                                                        range: Some(
                                                                                                                                            293..297,
                                                                                                                                        ),
                                                                                                                                    },
                                                                                                                                    WithRange {
                                                                                                                                        node: Empty,
                                                                                                                                        range: Some(
                                                                                                                                            297..297,
                                                                                                                                        ),
                                                                                                                                    },
                                                                                                                                ),
                                                                                                                                range: Some(
                                                                                                                                    293..297,
                                                                                                                                ),
                                                                                                                            },
                                                                                                                        },
                                                                                                                    ),
                                                                                                                    range: Some(
                                                                                                                        293..297,
                                                                                                                    ),
                                                                                                                },
                                                                                                            },
                                                                                                        ],
                                                                                                        range: Some(
                                                                                                            285..299,
                                                                                                        ),
                                                                                                    },
                                                                                                ),
                                                                                                range: Some(
                                                                                                    285..299,
                                                                                                ),
                                                                                            },
                                                                                        ),
                                                                                        range: Some(
                                                                                            278..299,
                                                                                        ),
                                                                                    },
                                                                                ),
                                                                                range: Some(
                                                                                    277..299,
                                                                                ),
                                                                            },
                                                                        },
                                                                    ),
                                                                    range: Some(
                                                                        277..299,
                                                                    ),
                                                                },
                                                            },
                                                            NamedSelection {
                                                                prefix: None,
                                                                path: WithRange {
                                                                    node: Path(
                                                                        PathSelection {
                                                                            path: WithRange {
                                                                                node: Key(
                                                                                    WithRange {
                                                                                        node: Field(
                                                                                            "extra",
                                                                                        ),
                                                                                        range: Some(
                                                                                            317..322,
                                                                                        ),
                                                                                    },
                                                                                    WithRange {
                                                                                        node: Empty,
                                                                                        range: Some(
                                                                                            322..322,
                                                                                        ),
                                                                                    },
                                                                                ),
                                                                                range: Some(
                                                                                    317..322,
                                                                                ),
                                                                            },
                                                                        },
                                                                    ),
                                                                    range: Some(
                                                                        317..322,
                                                                    ),
                                                                },
                                                            },
                                                        ],
                                                        range: Some(
                                                            86..336,
                                                        ),
                                                    },
                                                ),
                                                range: Some(
                                                    86..336,
                                                ),
                                            },
                                        ),
                                        range: Some(
                                            80..336,
                                        ),
                                    },
                                },
                            ),
                            range: Some(
                                80..336,
                            ),
                        },
                    },
                    NamedSelection {
                        prefix: Alias(
                            Alias {
                                name: WithRange {
                                    node: Field(
                                        "from",
                                    ),
                                    range: Some(
                                        350..354,
                                    ),
                                },
                                range: Some(
                                    350..355,
                                ),
                            },
                        ),
                        path: WithRange {
                            node: Path(
                                PathSelection {
                                    path: WithRange {
                                        node: Var(
                                            WithRange {
                                                node: $,
                                                range: Some(
                                                    356..357,
                                                ),
                                            },
                                            WithRange {
                                                node: Key(
                                                    WithRange {
                                                        node: Field(
                                                            "from",
                                                        ),
                                                        range: Some(
                                                            358..362,
                                                        ),
                                                    },
                                                    WithRange {
                                                        node: Empty,
                                                        range: Some(
                                                            362..362,
                                                        ),
                                                    },
                                                ),
                                                range: Some(
                                                    357..362,
                                                ),
                                            },
                                        ),
                                        range: Some(
                                            356..362,
                                        ),
                                    },
                                },
                            ),
                            range: Some(
                                356..362,
                            ),
                        },
                    },
                ],
                range: Some(
                    54..362,
                ),
            },
        ),
        spec: V0_3,
    },
)