# Before callback on graphql endpoints

**URL:** <https://community.parseplatform.org/t/before-callback-on-graphql-endpoints/2282>\
**Category:** GraphQL API\
**Created:** [December 10, 2021, 6:56pm UTC](https://community.parseplatform.org/t/before-callback-on-graphql-endpoints/2282 "2021-12-10T18:56:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunobg](https://community.parseplatform.org/user_avatar/community.parseplatform.org/brunobg/32/967_2.png) [@brunobg](https://community.parseplatform.org/u/brunobg)\
**Post date:** [December 10, 2021, 6:56pm UTC](https://community.parseplatform.org/t/before-callback-on-graphql-endpoints/2282/1 "2021-12-10T18:56:28Z")

</div>

Is there a way to get a callback called for graphql endpoints? Something like `beforeSave` for objects. Reason: I want to do dynamic checking of conditions for queries or mutations.

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [December 10, 2021, 7:53pm UTC](https://community.parseplatform.org/t/before-callback-on-graphql-endpoints/2282/2 "2021-12-10T19:53:33Z")

</div>

All triggers also work for the GraphQL mutations as well. So if you add a beforeSave trigger to SomeClass, it will also be triggered on createSomeClass mutation.

---

<div class="post-metadata">

**Author:** ![brunobg](https://community.parseplatform.org/user_avatar/community.parseplatform.org/brunobg/32/967_2.png) [@brunobg](https://community.parseplatform.org/u/brunobg)\
**Post date:** [December 10, 2021, 7:57pm UTC](https://community.parseplatform.org/t/before-callback-on-graphql-endpoints/2282/3 "2021-12-10T19:57:44Z")

</div>

But that will restrict the entire application, and not just GraphQL endpoints, right? Is there a specific callback for the GraphQL endpoint?

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [December 13, 2021, 6:16pm UTC](https://community.parseplatform.org/t/before-callback-on-graphql-endpoints/2282/4 "2021-12-13T18:16:27Z")

</div>

Yes. That would restrict to both REST and GraphQL APIs.
