---
source: apollo-router/src/query_planner/tests.rs
expression: query_plan
---
Sequence {
    nodes: [
        Fetch(
            FetchNode {
                service_name: "product",
                requires: [],
                variable_usages: [],
                operation: "{topProducts{__typename ...on Book{__typename isbn}...on Furniture{name}}product(upc:\"1\"){__typename ...on Book{__typename isbn}...on Furniture{name}}}",
                operation_name: Some(
                    "topProducts_product_0",
                ),
                operation_kind: Query,
                id: None,
                input_rewrites: None,
                output_rewrites: None,
                context_rewrites: None,
                schema_aware_hash: QueryHash(
                    "",
                ),
                authorization: CacheKeyMetadata {
                    is_authenticated: false,
                    scopes: [],
                    policies: [],
                },
            },
        ),
        Parallel {
            nodes: [
                Sequence {
                    nodes: [
                        Flatten(
                            FlattenNode {
                                path: Path(
                                    [
                                        Key(
                                            "topProducts",
                                            None,
                                        ),
                                        Flatten(
                                            None,
                                        ),
                                    ],
                                ),
                                node: Fetch(
                                    FetchNode {
                                        service_name: "books",
                                        requires: [
                                            InlineFragment(
                                                InlineFragment {
                                                    type_condition: Some(
                                                        "Book",
                                                    ),
                                                    selections: [
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "__typename",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "isbn",
                                                                selections: [],
                                                            },
                                                        ),
                                                    ],
                                                },
                                            ),
                                        ],
                                        variable_usages: [
                                            "test_variable",
                                        ],
                                        operation: "query($representations:[_Any!]!){_entities(representations:$representations){...on Book{__typename isbn title year}}}",
                                        operation_name: None,
                                        operation_kind: Query,
                                        id: None,
                                        input_rewrites: None,
                                        output_rewrites: None,
                                        context_rewrites: None,
                                        schema_aware_hash: QueryHash(
                                            "",
                                        ),
                                        authorization: CacheKeyMetadata {
                                            is_authenticated: false,
                                            scopes: [],
                                            policies: [],
                                        },
                                    },
                                ),
                            },
                        ),
                        Flatten(
                            FlattenNode {
                                path: Path(
                                    [
                                        Key(
                                            "topProducts",
                                            None,
                                        ),
                                        Flatten(
                                            None,
                                        ),
                                    ],
                                ),
                                node: Fetch(
                                    FetchNode {
                                        service_name: "product",
                                        requires: [
                                            InlineFragment(
                                                InlineFragment {
                                                    type_condition: Some(
                                                        "Book",
                                                    ),
                                                    selections: [
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "__typename",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "isbn",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "title",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "year",
                                                                selections: [],
                                                            },
                                                        ),
                                                    ],
                                                },
                                            ),
                                        ],
                                        variable_usages: [],
                                        operation: "query($representations:[_Any!]!){_entities(representations:$representations){...on Book{name}}}",
                                        operation_name: None,
                                        operation_kind: Query,
                                        id: None,
                                        input_rewrites: None,
                                        output_rewrites: None,
                                        context_rewrites: None,
                                        schema_aware_hash: QueryHash(
                                            "",
                                        ),
                                        authorization: CacheKeyMetadata {
                                            is_authenticated: false,
                                            scopes: [],
                                            policies: [],
                                        },
                                    },
                                ),
                            },
                        ),
                    ],
                },
                Sequence {
                    nodes: [
                        Flatten(
                            FlattenNode {
                                path: Path(
                                    [
                                        Key(
                                            "product",
                                            None,
                                        ),
                                    ],
                                ),
                                node: Fetch(
                                    FetchNode {
                                        service_name: "books",
                                        requires: [
                                            InlineFragment(
                                                InlineFragment {
                                                    type_condition: Some(
                                                        "Book",
                                                    ),
                                                    selections: [
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "__typename",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "isbn",
                                                                selections: [],
                                                            },
                                                        ),
                                                    ],
                                                },
                                            ),
                                        ],
                                        variable_usages: [],
                                        operation: "query($representations:[_Any!]!){_entities(representations:$representations){...on Book{__typename isbn title year}}}",
                                        operation_name: None,
                                        operation_kind: Query,
                                        id: None,
                                        input_rewrites: None,
                                        output_rewrites: None,
                                        context_rewrites: None,
                                        schema_aware_hash: QueryHash(
                                            "",
                                        ),
                                        authorization: CacheKeyMetadata {
                                            is_authenticated: false,
                                            scopes: [],
                                            policies: [],
                                        },
                                    },
                                ),
                            },
                        ),
                        Flatten(
                            FlattenNode {
                                path: Path(
                                    [
                                        Key(
                                            "product",
                                            None,
                                        ),
                                    ],
                                ),
                                node: Fetch(
                                    FetchNode {
                                        service_name: "product",
                                        requires: [
                                            InlineFragment(
                                                InlineFragment {
                                                    type_condition: Some(
                                                        "Book",
                                                    ),
                                                    selections: [
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "__typename",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "isbn",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "title",
                                                                selections: [],
                                                            },
                                                        ),
                                                        Field(
                                                            Field {
                                                                alias: None,
                                                                name: "year",
                                                                selections: [],
                                                            },
                                                        ),
                                                    ],
                                                },
                                            ),
                                        ],
                                        variable_usages: [],
                                        operation: "query($representations:[_Any!]!){_entities(representations:$representations){...on Book{name}}}",
                                        operation_name: None,
                                        operation_kind: Query,
                                        id: None,
                                        input_rewrites: None,
                                        output_rewrites: None,
                                        context_rewrites: None,
                                        schema_aware_hash: QueryHash(
                                            "",
                                        ),
                                        authorization: CacheKeyMetadata {
                                            is_authenticated: false,
                                            scopes: [],
                                            policies: [],
                                        },
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ],
        },
    ],
}
