Int64 type?

How does one use the Int64 type? According to this page versions >= 20.11 support it. I am using the latest Docker image:

docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph --name dgraph dgraph/standalone:latest

I’m trying this:

import pydgraph

stub = pydgraph.DgraphClientStub('localhost:9080')
client = pydgraph.DgraphClient(stub)

client.alter(pydgraph.Operation(drop_all=True))

schema = """
name: string @index(exact) .
friend: [uid] @reverse .
age: Int64 @index(Int64) .
married: bool .
loc: geo .
dob: datetime .

type Person {
name
friend
age
married
loc
dob
}
"""

client.alter(pydgraph.Operation(schema=schema))

and I get this error message:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "line 4 column 5: Undefined Type"
	debug_error_string = "{"created":"@1639585824.578455000","description":"Error received from peer ipv6:[::1]:9080","file":"src/core/lib/surface/call.cc","file_line":1064,"grpc_message":"line 4 column 5: Undefined Type","grpc_status":2}"
>

If I replace Int64 with Int everything seems to work fine.

Thanks for any help with this hopefully easy question.

1 Like

You linked to the GraphQL types. Look at the DQL datatypes instead:

https://dgraph.io/docs/query-language/schema/

The datatype int is equal to golang int64

3 Likes

Thanks, I guess I’m still learning the differences/distinction between the two.

1 Like