DateTime Schema definition

So, as this is a GraphQL related question, you should use GraphQL tag and made it under Users/Graphql. If you use Dgraph, we gonna think that you are asking about DQL.

PS. I have edited the tag and move the topic.

This syntax is DQL, not GraphQL. So it would never work. This is the right docs for it https://dgraph.io/docs/graphql/schema/search/

e.g

type Post {
    ...
    creationTime: DateTime @search(by: [hour])
}

See https://dgraph.io/docs/graphql/schema/search/#datetime

If you are on the road to GraphQL you should stick to /admin/schema. The Alter endpoint is exclusive to DQL. And if you stick to GraphQL, Dgraph will handle the schema for you.

The Tour part was created to be DQL, it can be worked to be work with GraphQL, but there are several examples and tutorials in the GraphQL part. The Tour is meant to show you what Dgraph can do. I can work on an extra tour that teaches how to convert DQL to GraphQL. But that is a long story* to do.

3 Likes