# Error importing schema

**URL:** <https://discuss.dgraph.io/t/error-importing-schema/12862>\
**Category:** GraphQL\
**Tags:** kind:question, dgraph\
**Created:** [February 21, 2021, 10:18am UTC](https://discuss.dgraph.io/t/error-importing-schema/12862 "2021-02-21T10:18:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LJ1090](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/lj1090/32/6318_2.png) [@LJ1090](https://discuss.dgraph.io/u/LJ1090)\
**Post date:** [February 21, 2021, 10:18am UTC](https://discuss.dgraph.io/t/error-importing-schema/12862/1 "2021-02-21T10:18:35Z")

</div>

Hi all,

I wanted to try out DGraph locally (using the latest Docker standalone version for DGraph) before using Slash Graphql. But I am stuck at altering my schema via the `http-js` client. When I’m trying to import an example schema I found in the docs I get an error when I run `dgraphClient.alter({ schema})`:

> Expected new line after field declaration. Got @

It seems the client can’t read the `@` symbol.

Here is the shema I am trying to import:

```auto
type Task {
  id: ID!
  title: String! @search(by: [fulltext])
  completed: Boolean! @search
  user: User!
}

type User {
  username: String! @id @search(by: [hash])
  name: String @search(by: [exact])
  tasks: [Task] @hasInverse(field: user)
}

```

Am I mixing up the schema definition with a graphQL file?

Thanks in Advance

---

<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:** [February 21, 2021, 2:29pm UTC](https://discuss.dgraph.io/t/error-importing-schema/12862/2 "2021-02-21T14:29:15Z")

</div>

> [@LJ1090](#):
>
> Am I mixing up the schema definition with a graphQL file?

This schema you are trying to send is a GraphQL one. All Dgraph’s clients are DQL. They don’t support GraphQL. Use Insomnia, postman, or some GraphQL client point to /admin to send that schema.

> **[Administrative API - GraphQL](https://dgraph.io/docs/graphql/admin/#using-adminschema)**
>
> This documentation presents the Admin API and explains how to run a Dgraph database with GraphQL.

---

<div class="post-metadata">

**Author:** ![LJ1090](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/lj1090/32/6318_2.png) [@LJ1090](https://discuss.dgraph.io/u/LJ1090)\
**Post date:** [February 21, 2021, 6:37pm UTC](https://discuss.dgraph.io/t/error-importing-schema/12862/3 "2021-02-21T18:37:23Z")

</div>

Thanks a lot @MichelDiz !  
So this also means that if I want to have an API layer in between Slash Graphql and my frontend that has a Graphql endpoint I need two schemas? And in the API layer I somehow have to translate Graphql to DQL and vice-versa?

```auto
Frontend (/graphql)--> API layer (graphql <-> DQL) --> Slash Graphql

```

---

<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:** [February 21, 2021, 6:47pm UTC](https://discuss.dgraph.io/t/error-importing-schema/12862/4 "2021-02-21T18:47:35Z")

</div>

> [@LJ1090](#):
>
> So this also means that if I want to have an API layer in between Slash Graphql and my frontend that has a Graphql endpoint I need two schemas?

If you have another GraphQL server, you have to find a way to mix them. There is Apollo Federation and we have some engineers working on it. That’s an option for you.

> [@LJ1090](#):
>
> And in the API layer I somehow have to translate Graphql to DQL and vice-versa?

If you wanna have your own GraphQL server that accesses Dgraph, you have to deal with DQL yourself. But Dgraph’s GraphQL feature is an automated GraphQL server based on your schema. So you won’t be bothered with business logic. Dgraph deals with business logic and DQL at the core level.

> [@LJ1090](#):
>
> `Slash Graphql`

Slash Graphql is just a hosted service that handles Dgraph and the infrastructure for you.

---

<div class="post-metadata">

**Author:** ![LJ1090](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/lj1090/32/6318_2.png) [@LJ1090](https://discuss.dgraph.io/u/LJ1090)\
**Post date:** [February 21, 2021, 8:45pm UTC](https://discuss.dgraph.io/t/error-importing-schema/12862/5 "2021-02-21T20:45:12Z")

</div>

Thanks again!

The thing is I just want to try out DGraph. Usually, I learn new technolgies using TDD and by writing a small test app because the developing workflow and also the possibility to develop locally is very important to me.  
So I think I’m just looking for a way to have a (fully) tested & flexible app and then deploy it using Slash Graphql instead of hosting the database myself or using the more expensive pricing plans.

Btw, sorry if I’m hijacking the topic of this thread - maybe I should create a new one with that question.

---

<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:** [February 21, 2021, 9:00pm UTC](https://discuss.dgraph.io/t/error-importing-schema/12862/6 "2021-02-21T21:00:13Z")

</div>

No problem, feel free to ask. But if you think the topic is good enough to create a new Discourse topic. Please, do. That helps others in the future searching for specific themes.
