Skip to Content

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

FieldTypeNullableDescriptionRelationship
idIntYesUnique identifier for the author
firstNameStringYesAuthor’s first name
lastNameStringYesAuthor’s last name
emailStringYesAuthor’s email address
bioStringYesAuthor’s biography or profile description
homepageStringYesAuthor’s homepage URL
imageStringYesURL to the author’s avatar image

Relationships

  • The Author type is referenced by the author field on the Article object 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 Author type 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.

  • Article: The author field on the Article type returns an Author object, linking articles to their authors.

Best Practices

  • Always select only the fields you need to optimize query performance.
  • Use the id field 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 Author type are optional and may return null if data is unavailable.
  • The API currently requires no authentication, but this may change in future versions.
  • The image field returns a URL string; clients should handle image loading and errors gracefully.
  • No computed or derived fields are defined on the Author type.
  • No field arguments are defined on the Author type fields.
Last updated on