Skip to main content

Numeric IDs for User

  • October 9, 2019
  • 2 replies
  • 1327 views

gianluigi

Hello everyone, I noticed that a query listing my users returns numeric IDs for the User entity. While other entities have string IDS (e.g. boards, items). Do you know the reason of this difference of results ?

My query for users:
query {
users {
id
name
email
}
}

returns the following:

{
“data”: {
“users”: [
{
“name”: “Gianluigi Rubino”,
“id”: 10124622,
“email”: “XXXX”
}
],
“complexity”: {
“before”: 10000000,
“query”: 3010,
“after”: 9996990
}
},
“account_id”: 000000
}

This topic has been closed for replies.

2 replies

dipro
Forum|alt.badge.img
  • Leader
  • October 17, 2019

Hey @gianluigi – welcome to the community!

Board and item IDs are not exactly strings, they have the type “ID”. This type is one of the primitive types in GraphQL (see this article) and are returned as strings in the JSON results. Meanwhile, user IDs are regular integers.

Let me know if that clarifies! 📖
Dipro


gianluigi
  • Author
  • Participating Frequently
  • October 18, 2019

Hi @dipro I was not aware of the distinction between type “ID” and strings, and this clarifies why those IDs are serialized in JSON as strings. I’m wondering: why did you use “ID” and integers for your different types ? Would have been more consistent to use just one type ?

This is an honest question, not a critic, trying to better understand your API’s design decisions.