# @cascade directive not properly propagated on Query

**URL:** <https://discuss.dgraph.io/t/cascade-directive-not-properly-propagated-on-query/9365>\
**Category:** GraphQL\
**Created:** [August 11, 2020, 1:48pm UTC](https://discuss.dgraph.io/t/cascade-directive-not-properly-propagated-on-query/9365 "2020-08-11T13:48:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luscha](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/luscha/32/3588_2.png) [@Luscha](https://discuss.dgraph.io/u/Luscha)\
**Post date:** [August 11, 2020, 1:48pm UTC](https://discuss.dgraph.io/t/cascade-directive-not-properly-propagated-on-query/9365/1 "2020-08-11T13:48:13Z")

</div>

Using the @cascade directive on query directly against dgraph’s GrapgQL endpoint works fine and prunes the results:

```auto
query {
  queryAnime(first: 10) @cascade {
    id
    names {
      localization (filter:{
        id: {eq:"UNDEFINED"}
      }){
        id
      }
      text (filter: {string: {alloftext:"秦时明月 特别篇: 空山鸟语"}}){
        string
      }
    }
  }
}

```

=\>

```auto
{
  "data": {
    "queryAnime": [
      {
        "id": "XL84UE",
        "names": [
          {
            "localization": {
              "id": "UNDEFINED"
            },
            "text": {
              "string": "秦时明月 特别篇: 空山鸟语"
            }
          }
        ]
      }
    ]
  },
  "extensions": {
    "touched_uids": 247,
    "tracing": {
      "version": 1,
      "startTime": "2020-08-11T13:33:11.405041351Z",
      "endTime": "2020-08-11T13:33:11.628524341Z",
      "duration": 223483047,
      "execution": {
        "resolvers": [
          {
            "path": [
              "queryAnime"
            ],
            "parentType": "Query",
            "fieldName": "queryAnime",
            "returnType": "[Anime]",
            "startOffset": 135443,
            "duration": 223312664,
            "dgraph": [
              {
                "label": "query",
                "startOffset": 204417,
                "duration": 222921243
              }
            ]
          }
        ]
      }
    }
  }
}

```

but once dgraph is wrapped by an Apollo Server (using [this](https://github.com/dgraph-io/graphql-asia-workshop-2020/tree/master/apollo-dgraph) guide), the directives stops to works:

```auto
{
  "data": {
    "queryAnime": [
      {
        "id": "XL84UE",
        "names": [
          null,
          null,
          null,
          null,
          {
            "localization": {
              "id": "UNDEFINED"
            },
            "text": {
              "string": "秦时明月 特别篇: 空山鸟语"
            }
          },
          null
        ]
      },
      {
        "id": "UJKQZ3",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "M3O5HL",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "ZC1XA1",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "K4P8OG",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "ISJJ6K",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "0467PM",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "46KC6K",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "OC16NE",
        "names": [
          null,
          null,
          null,
          null,
          null
        ]
      },
      {
        "id": "7BFSRI",
        "names": [
          null,
          null,
          null,
          null,
          null,
          null
        ]
      }
    ]
  }
}

```

I couldn’t find anything about delegation of directives on the apollo doc nor graphql-tool doc, and the dgraph page which lists the directives is still incomplete so I couldn’t find any solution / explanation.

Is that a bug or is it a misconfiguration of the Apollo server?

I would point out that this behaviour occurs only when the directive is used on query, using it on fields works perfectly
