Created
February 5, 2018 10:21
-
-
Save colinappnovation/7a6eabefd08f496617ee5d037682e5bf to your computer and use it in GitHub Desktop.
Working GraphQL query with fragment against Drupal 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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