-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(data): add custom header support to data schema client #12559
Conversation
…d types; add custom headers for subscriptions
Addressing merge conflicts now |
Merge conflicts resolved |
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.
CustomerHeaders
can also be an async () => Promise<Headers>
. Can we see a couple tests using that form?
Good callout! Will add these |
These have been added. |
6bddab9
to
5bdc907
Compare
2556bd9
to
1961e83
Compare
packages/api-graphql/__tests__/AWSAppSyncRealTimeProvider.test.ts
Outdated
Show resolved
Hide resolved
37fb862
to
092beb0
Compare
if (authToken) { | ||
headers.Authorization = authToken; | ||
} | ||
|
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 has been moved to _graphql
and the AWSAppSyncRealTimeProvider
so that we can add this to both static and functional header output.
35957bc
to
6378ca6
Compare
additionalHeaders: expect.objectContaining({ | ||
Authorization: 'some-token', | ||
}), | ||
authToken: 'some-token', |
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 will still be included in the header as it was previously, but not at this call-site (i.e. this will happen later).
additionalHeaders: expect.objectContaining({ | ||
Authorization: 'some-token', | ||
}), | ||
authToken: 'some-token', |
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 will still be included in the header as it was previously, but not at this call-site (i.e. this will happen later).
6378ca6
to
0af3e15
Compare
Description of changes
Custom headers can now be supplied to both the generated client, as well as to individual model operations (including subscriptions). Includes improved type updates to existing headers, and better documentation around the usage of existing custom headers.
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.