Skip to content

Instantly share code, notes, and snippets.

@dz
Forked from thomsbg/hybrid.graphql
Last active February 5, 2018 20:18
Show Gist options
  • Save dz/ca616426dab69c33bf44b7e05d9222d6 to your computer and use it in GitHub Desktop.
Save dz/ca616426dab69c33bf44b7e05d9222d6 to your computer and use it in GitHub Desktop.
entry(id: 1234) {
ledeImage {
river: ratio(...),
hero_oneup: ratio(...),
image_above: ratio(...)
}
}
# 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) {
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