@id with type Int

Experience Report for Feature Request

trying to have a

id: Int! @id

I got:

Field id: with @id directive must be of type String!, not Int!

What you wanted to do

i have an external identifier that is of type int.

What you actually did

i use type String!

Why that wasn’t great, with examples

Strings use more memory

Any external references to support your case

1 Like

Made this into a formal feature request (ran into this issue myself today).

Another rationale: when using the @id directive, one is typically taking the ID in from another system. Having an Int represented as a string requires a lot of parsing to and from strings and ints. This leads to excessive computations.