GraphQL has a built-in ID
scalar type, which represents a unique identifier
.
cache
.The ID
type is serialized in the same way as a String
ID
signifies that it is not intended to be human‐readable.It is best to rely on existing libs or tool sets that provide handling of object identifiers
You can specify a unique identifier
for any object you query.
object identifier
represent the same piece of information.Even if the entrypoint
or the query
looks different, GraphQL recognizes the queries as the same object and caches/returns it:
query { author(name: "Arthur Goldhammer") { coauthors { name id } } } query { author(id: "5") { name id } }