Skip to content

Instantly share code, notes, and snippets.

@cesarmiquel
Last active August 31, 2020 23:03
Show Gist options
  • Save cesarmiquel/8d6da994156d7130161191499e7e64e6 to your computer and use it in GitHub Desktop.
Save cesarmiquel/8d6da994156d7130161191499e7e64e6 to your computer and use it in GitHub Desktop.
GraphQL - Drupal - Node query
#
# Query published nodes of type article
#
query {
nodeQuery(
filter:{
conditions:[
{field:"type", value:"article"},
{field:"status", value: "1"}
]
},
sort:{field:"created", direction:DESC},
limit: 5
) {
entities{
... on NodeArticle{
id:entityId
title
promote
changed
created
thumbnail: fieldVideoPlaceholder {
image:entity {
... on MediaImage {
fieldMediaImage{
thumbnail: derivative(style:_11MAX164PX) {
url
}
}
}
}
}
entityUrl {
path
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment