Skip to content

DEVDOCS-6035: [update] geography nodes #908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/storefront/graphql/examples/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,43 @@ Analytics IDs are available only after configuring the analytics service provide
```

<a href="https://developer.bigcommerce.com/graphql-storefront/playground" target="_blank">**Try it in GraphQL Playground**</a>

## Get a list of countries

The `geography` node provides a list of all supported shipping countries and their corresponding states or provinces. By default, the full list is returned unless you apply a filter. To narrow down the list, you can use the **Settings** > **Shipping** > **Checkout shipping options** filter in the control panel. This filter limits the results to only those countries included in your active shipping zones.

```graphql filename="Example query: Get list of countries" showLineNumbers copy
{
site {
settings {
shipping {
supportedShippingDestinations {
countries { # same schema as geography node, but implicitly filtered
entityId
code
name
statesOrProvinces {
entityId
name
abbreviation
}
}
}
}
}
}
geography { # geography node is available at the top level still for unfiltered use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
geography { # geography node is available at the top level still for unfiltered use
geography {

I doubt this comment should be in the official docs, the same as above one - they were more addressed to person taking the ticket.

countries {
entityId
code
name
statesOrProvinces {
entityId
name
abbreviation
}
}
}
}
```
<a href="https://developer.bigcommerce.com/graphql-storefront/playground" target="_blank">**Try it in GraphQL Playground**</a>