# Modify schema in transaction?

**URL:** <https://discuss.dgraph.io/t/modify-schema-in-transaction/11968>\
**Category:** Dgraph\
**Tags:** kind:question, dgraph\
**Created:** [December 17, 2020, 7:07pm UTC](https://discuss.dgraph.io/t/modify-schema-in-transaction/11968 "2020-12-17T19:07:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tron](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/tron/32/5155_2.png) [@tron](https://discuss.dgraph.io/u/tron)\
**Post date:** [December 17, 2020, 7:07pm UTC](https://discuss.dgraph.io/t/modify-schema-in-transaction/11968/1 "2020-12-17T19:07:10Z")

</div>

I’m using the JavaScript gRPC client, and I’m familiar with the [example](https://github.com/dgraph-io/dgraph-js#altering-the-database) for altering the database…

```auto
const schema = "name: string @index(exact) .";
const op = new dgraph.Operation();
op.setSchema(schema);
await dgraphClient.alter(op);

```

…but is it possible to modify the schema in a transaction, so I can abort if needed and not have any schema changes take effect?

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [December 17, 2020, 10:36pm UTC](https://discuss.dgraph.io/t/modify-schema-in-transaction/11968/2 "2020-12-17T22:36:47Z")

</div>

Nope, as far as I know. Alter Schema is an operation.
