Skip to content
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

graphql: utilize default auth #12586

Merged
merged 6 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"lerna": "^6.6.1",
"license-check-and-add": "^4.0.5",
"prettier": "^3.1.0",
"pretty-quick": "^1.11.1",
"pretty-quick": "^3.1.3",
"rimraf": "^2.6.2",
"rollup": "^0.67.4",
"rollup-plugin-commonjs": "^9.2.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/api-graphql/src/internals/InternalGraphQLAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class InternalGraphQLAPIClass {

private async _graphql<T = any>(
amplify: AmplifyClassV6,
{ query, variables, authMode }: GraphQLOptions,
{ query, variables, authMode: explicitAuthMode }: GraphQLOptions,
additionalHeaders: CustomHeaders = {},
abortController: AbortController,
customUserAgentDetails?: CustomUserAgentDetails,
Expand All @@ -238,8 +238,11 @@ export class InternalGraphQLAPIClass {
endpoint: appSyncGraphqlEndpoint,
customEndpoint,
customEndpointRegion,
defaultAuthMode
} = resolveConfig(amplify);

const authMode = explicitAuthMode ?? defaultAuthMode;

Copy link
Member Author

@iartemiev iartemiev Nov 17, 2023

Choose a reason for hiding this comment

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

Around line 327 of this file we skip setting signingServiceInfo when authMode is undefined. That's the source of the bug.

/**
* Retrieve library options from Amplify configuration.
* `customHeaders` here are from the Amplify configuration options,
Expand Down
148 changes: 61 additions & 87 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.