Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@drewbaker
Last active February 1, 2023 15:11
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 drewbaker/196f2e7816d0fa6229243f316c41525d to your computer and use it in GitHub Desktop.
Save drewbaker/196f2e7816d0fa6229243f316c41525d to your computer and use it in GitHub Desktop.
This is used to generate the mock-api.json file used by fuxt
query MockApi {
home: page(id: "/featured", idType: URI) {
id
title
excerpt
content
uri
featuredImage {
node {
...MediaImage
}
}
}
featured: page(id: "/featured", idType: URI) {
id
title
uri
children {
nodes {
id
... on Page {
...PageDeatil
}
}
}
}
directors: page(id: "/directors", idType: URI) {
id
title
uri
children {
nodes {
id
... on Page {
...PageDeatil
}
}
}
}
posts {
nodes {
id
title
uri
excerpt
content
featuredImage {
node {
...MediaImage
}
}
}
}
images: mediaItems(where: {orderby: {field: DATE, order: DESC}}) {
nodes {
...MediaImage
}
}
logos: mediaItems(where: {orderby: {field: DATE, order: DESC}}) {
nodes {
id
# Replace the URLs manually until we can where: for SVGs only
sourceUrl
}
}
menu(id: "Main Menu", idType: NAME) {
id
name
menuItems {
nodes {
...MenuItem
}
}
}
}
fragment MediaImage on MediaItem {
sourceUrl(size: FULLSCREEN_XLARGE)
sizes(size: FULLSCREEN_XLARGE)
srcSet(size: FULLSCREEN_XLARGE)
src: sourceUrl(size: FULLSCREEN_SMALL)
id
databaseId
title
altText
caption
mediaDetails {
height
width
}
imageMeta {
videoUrl
primaryColor
focalPointX
focalPointY
blurhash
}
}
fragment PageDeatil on Page {
id
title
content
excerpt
uri
acfPageMeta {
videoUrl
}
featuredImage {
node {
...MediaImage
}
}
}
fragment MenuItem on MenuItem {
label
cssClasses
target
url
id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment