Author
Represents an author of a blog post or article.
Type Definition
type Author {
id: Int
firstName: String
lastName: String
email: String
bio: String
homepage: String
image: String
}Fields
| Field | Type | Nullable | Description | Relationship |
|---|---|---|---|---|
| id | Int | Yes | Unique identifier for the author | — |
| firstName | String | Yes | Author’s first name | — |
| lastName | String | Yes | Author’s last name | — |
| String | Yes | Author’s email address | — | |
| bio | String | Yes | Author’s biography or profile description | — |
| homepage | String | Yes | Author’s homepage URL | — |
| image | String | Yes | URL to the author’s avatar image | — |
Relationships
- The
Authortype is referenced by theauthorfield on theArticleobject type. - This relationship allows retrieval of author details when querying articles.
Usage Examples
Basic Query
query {
author(id: 12345) {
id
firstName
lastName
email
bio
}
}Field Selection
query {
author(id: 12345) {
firstName
lastName
homepage
image
}
}Nested Queries
query {
article(id: 67890) {
title
author {
firstName
lastName
email
bio
}
}
}Filtering and Sorting
Note: The
Authortype itself does not define filtering or sorting fields. Filtering and sorting should be applied on the parent query that returns authors or articles referencing authors.
Example filtering authors by lastName in a hypothetical authors query:
query {
authors(filter: { lastName: "Smith" }, sort: { field: "firstName", direction: ASC }) {
edges {
node {
id
firstName
lastName
email
}
}
}
}This example assumes the existence of an authors connection query supporting filtering and sorting.
Implements
This type does not implement any interfaces.
Connections
No direct connections are defined on the Author type.
Related Types
- Article: The
authorfield on theArticletype returns anAuthorobject, linking articles to their authors.
Best Practices
- Always select only the fields you need to optimize query performance.
- Use the
idfield to uniquely identify authors when querying or updating data. - When querying articles, use nested queries to fetch author details efficiently.
- Cache author data where possible to reduce repeated network requests, especially for frequently accessed authors.
Notes
- All fields on the
Authortype are optional and may returnnullif data is unavailable. - The API currently requires no authentication, but this may change in future versions.
- The
imagefield returns a URL string; clients should handle image loading and errors gracefully. - No computed or derived fields are defined on the
Authortype. - No field arguments are defined on the
Authortype fields.
Last updated on