Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinappnovation/7a6eabefd08f496617ee5d037682e5bf to your computer and use it in GitHub Desktop.
Save colinappnovation/7a6eabefd08f496617ee5d037682e5bf to your computer and use it in GitHub Desktop.
Working GraphQL query with fragment against Drupal 8
{
nodeQuery(filter: {status: true, type: "article"}, limit: 5) {
totalCount: count
entities {
nid: entityId
title: entityLabel
... on NodeArticle {
body {
summary
}
...imageThumbnail
}
}
}
}
fragment imageThumbnail on NodeArticle {
fieldImage {
image: derivative(style: thumbnail) {
url
height
width
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment