Skip to content

Instantly share code, notes, and snippets.

@jackwiy
Forked from aleandro-coppola/countries-list.js
Created September 6, 2024 11:41
Show Gist options
  • Save jackwiy/32af1294858afe910352f6827dc9fb2c to your computer and use it in GitHub Desktop.
Save jackwiy/32af1294858afe910352f6827dc9fb2c to your computer and use it in GitHub Desktop.
Free countries list
const resp = await fetch('https://atlas.shopifysvc.com/graphql', {
method: 'POST',
body: JSON.stringify({
query: `query countries($locale: SupportedLocale!) {
countries(locale: $locale) {
name
code
provinces {
code
name
}
}
}`,
variables: {
locale: 'IT',
},
}),
headers: {
'content-type': 'application/json',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment