# Creating a schema with dgo and reporting an error

**URL:** <https://discuss.dgraph.io/t/creating-a-schema-with-dgo-and-reporting-an-error/18945>\
**Category:** GraphQL\
**Tags:** kind:question\
**Created:** [September 28, 2023, 8:50am UTC](https://discuss.dgraph.io/t/creating-a-schema-with-dgo-and-reporting-an-error/18945 "2023-09-28T08:50:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tellixu](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@tellixu](https://discuss.dgraph.io/u/tellixu)\
**Post date:** [September 28, 2023, 8:50am UTC](https://discuss.dgraph.io/t/creating-a-schema-with-dgo-and-reporting-an-error/18945/1 "2023-09-28T08:50:54Z")

</div>

I ran a case from the official document and created a schema using dgo, but the result was an error

```auto
conn, err := grpc.Dial("192.168.1.252:9080", grpc.WithTransportCredentials(insecure.NewCredentials()))
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	defer func() {
		_ = conn.Close()
	}()
	dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(conn))
	dqlTxt := `type Product {
    productID: ID!
    name: String @search(by: [term])
    reviews: [Review] @hasInverse(field: about)
}

type Customer {
    username: String! @id @search(by: [hash, regexp])
    reviews: [Review] @hasInverse(field: by)
}

type Review {
    id: ID!
    about: Product!
    by: Customer!
    comment: String @search(by: [fulltext])
    rating: Int @search
}`
	op := api.Operation{
		Schema: dqlTxt,
		RunInBackground: true,
	}
	err1 := dgraphClient.Alter(context.Background(), &op)
	if err1 != nil {
		fmt.Println(err1.Error())
	}
}

```

The error content is

```auto
rpc error: code = Unknown desc = line 3 column 17: Expected new line after field declaration. Got @

```

---

<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:** [September 28, 2023, 3:22pm UTC](https://discuss.dgraph.io/t/creating-a-schema-with-dgo-and-reporting-an-error/18945/2 "2023-09-28T15:22:52Z")

</div>

You are sending a GraphQL schema. Dgo isn’t a GraphQL Client. You should send it to /admin/schema via Postman or another GraphQL UI or even some lib that is a GraphQL client in Go.
