Entity schema
Checkpoint requires a set of defined GraphQL Schema Objects. The schema objects will be used to create a database structure for indexing this data and also generating GraphQL Queries for accessing the indexed data.
In Checkpoint terms, these schema objects are called Entities
, an Entity can be defined as a GraphQL Object with a unique name and an id
field.
For example:
Vote
and User
are valid entities because their names are unique (within the schema) and contain an id
field.
Query generation
Checkpoint generates two Query fields for each of the defined entities. One for querying a single entity record by its id and the second for querying multiple records of an entity.
For example, using the earlier defined User
entity, Checkpoint will generate two query fields like:
Things to note:
The name of the single record entity query is derived from the entity's name lowercased.
The name of the multi-record entity query is derived from the entity's name lowercased with an
s
suffix.The generated
Where*
types fields for multi-record are derived based on original fields in the entity, and non-null values are treated aAND
where filters when being executed against the database.
Last updated