-
Notifications
You must be signed in to change notification settings - Fork 52
DEVDOCS-6506 - B2B Edition GraphQL Storefront API - Overview #1141
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
base: main
Are you sure you want to change the base?
Conversation
Created a net new overview doc for the B2B Edition GraphQL Storefront API.
|
I will create a companion PR in |
|
|
||
| ## Pagination | ||
|
|
||
| All queries that return a list of items follow the [Cursor Connections](https://facebook.github.io/relay/graphql/connections.htm) pattern, allowing you to paginate results and communicate whether additional results are available. To learn more about utilizing pagination, see the [BigCommerce GraphQL Storefront API overview](/docs/storefront/graphql#pagination). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to read sentence (confidence: 5/7) retext-readability retext-readability
| "channelId":"1" | ||
| } | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing and
| </Tab> | |
| </Tabs> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not seeing what's missing but yeah ... suggested fix.
| .catch((err) => console.error(err)); | ||
| </script> | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| </Tab> | |
| </Tabs> | |
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```jhtml filename="Authenticated query using getB2BToken" showLineNumbers copy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ```jhtml filename="Authenticated query using getB2BToken" showLineNumbers copy | |
| ```html filename="Authenticated query using getB2BToken" showLineNumbers copy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
picking nits, but this will fix the syntax highlighting
|
|
||
| You can return extra field information in queries as well as specify field values in mutations that create or update new records. See the query below for how you can include extra fields in your requests. | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For syntax highlighting
| ``` | |
| ```graphql copy |
| @@ -0,0 +1,218 @@ | |||
| # B2B Edition GraphQL Storefront API overview | |||
|
|
|||
| The B2B Edition GraphQL Storefront API provides a dynamic method for querying and modifying B2B Edition data from your storefront applications. The GraphQL Storefront API powers the Buyer Portal, and allows you to customize your buyers’ B2B experience on hosted and headless storefronts. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"powers the Buyer Portal and allows" (no comma)
|
|
||
| Using the B2B Edition GraphQL Storefront API, you can: | ||
|
|
||
| * Create a registration form for new Company accounts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Register new Company accounts" (not quite accurate to say the GraphQL "creates a registration form")
|
|
||
| ## Authentication | ||
|
|
||
| The B2B Edition GraphQL Storefront API uses storefront authTokens to authenticate requests. You must add your token to the request header in the following format: `"Authorization": "Bearer [token value]"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's really important right off the bat to emphasize anonymous vs. authorized requests, especially as this pattern is so different from what devs are used to with the BC GraphQL Storefront API.
Here are what I consider key points that would be worth including in the beginning of the discussion on authentication:
- Queries/mutations are either anonymous (like the login mutation itself) or authenticated.
- Anonymous queries/mutations don't require any kind of authentication token/header at all.
- Authenticated queries/mutations require the
Authorizationbearer token as described.
This is as opposed to the BC GraphQL Storefront API, which ALWAYS requires a bearer token, and where the user-specific Customer Access Token is totally separate.
Not suggesting that we necessarily must directly discuss the contrast, but I think it would be good to explicitly refer to anonymous vs authenticated, in a way that's 100% clear to be people used to the other pattern.
|
|
||
| ## FAQ | ||
|
|
||
| **Does the B2B Edition GraphQL Storefront API support webhooks?** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels out of place to me. I'm not sure how a GraphQL API would "support webhooks."
Created a net new overview doc for the B2B Edition GraphQL Storefront API.
DEVDOCS-6506
What changed?
Release notes draft