Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
entry(id: 1234) {
bylines {
name
url
}
}
# The API knows to fetch from various database sources,
# and returns full names vs usernames according to community rules,
# but leaves the formatting as HTML, and comma-joining up to the client
entry(id: 1234) {
byline # <a href="/authors/alice">Alice Author</a>, <a href="/users/connie">Connie Contributor</a>, <a href="http://freddy.name/">Freddy Freelancer</a>
}
# The API knows how to fetch and format the full byline,
# merging together the various db sources for you,
# and respecting community rules on username vs full name.
# The client doesn't have to do anything but drop this into a template.
entry(id: 1234) {
author {
firstName
lastName
username
profileUrl
}
contributors {
firstName
lastName
username
profileUrl
}
additionalByline # <a href="http://freddy.name/">Freddy Freelancer</a>
}
# the api provides data in its raw format, as represented in the database.
# the client decides how to format author names based on community settings,
# create <a> tags, and comma join all of this together
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment