GraphQL and UUID type on Postgres
Hasura GraphQL Engine supports Postgres UUID type implicitly, allowing UUID values to be provided as strings. A primary key is essential for every table in a database and is typically an auto-incrementing integer called a serial id. However, a more robust alternative is the UUID (Universally Unique Identifier), which is a 128-bit number that is nearly impossible to duplicate, making it ideal for use as primary keys. The Postgres UUID data type stores UUIDs as defined by RFC 4122 and has several advantages such as preventing information leaks, independent generation, random distribution, and more. However, there are also some disadvantages like size constraints, difficulty in debugging, lack of easy ordering, and potential performance issues. Hasura GraphQL Engine supports UUID types implicitly, allowing for simple queries and insertions with UUIDs.
Company
Hasura
Date published
Aug. 17, 2018
Author(s)
Sandip
Word count
750
Language
English
Hacker News points
None found.