Skip to content

Instantly share code, notes, and snippets.

@ChrisHPZ
Created October 29, 2023 12:52
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 ChrisHPZ/5f4f58229a37870598d7a47c3c1f2f84 to your computer and use it in GitHub Desktop.
Save ChrisHPZ/5f4f58229a37870598d7a47c3c1f2f84 to your computer and use it in GitHub Desktop.
Advanced Custom Fields Query
import { graphqlRequest } from "./graphqlRequest";
export async function getContactInfo() {
const query = {
query:`
query acfContactInfo {
aCFOptions {
optionsFields {
contactText
emailAddress
phoneNumber
}
}
}
`
}
const resJson = await graphqlRequest(query);
const contactInfo = resJson.data.aCFOptions;
return contactInfo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment