Skip to content

Commit

Permalink
api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mcafee committed Sep 11, 2023
1 parent 38b3cb5 commit 9929d33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ export class AWSAppSyncRealTimeProvider {
}: AWSAppSyncRealTimeAuthInput): Promise<
Record<string, unknown> | undefined
> {
debugger;
const headerHandler: {
[key: string]: (AWSAppSyncRealTimeAuthInput) => {};
} = {
Expand Down
6 changes: 0 additions & 6 deletions packages/api-graphql/src/internals/InternalGraphQLAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export class InternalGraphQLAPIClass {
* @return {Object} - The current configuration
*/
configure(options) {
debugger;
const { API = {}, ...otherOptions } = options || {};
let opt = { ...otherOptions, ...API };
logger.debug('configure GraphQL API', { opt });
Expand Down Expand Up @@ -126,7 +125,6 @@ export class InternalGraphQLAPIClass {
* @return - A promise of true if Success
*/
createInstance() {
debugger;
logger.debug('create Rest instance');
if (this._options) {
// TODO: remove options, use getConfig here
Expand All @@ -149,7 +147,6 @@ export class InternalGraphQLAPIClass {
additionalHeaders: { [key: string]: string } = {},
customUserAgentDetails?: CustomUserAgentDetails
) {
debugger;
// TODO: Amplify.getConfig().API
// apikey is the same (but needs to be on the config)
const { aws_appsync_authenticationType, aws_appsync_apiKey: apiKey } =
Expand Down Expand Up @@ -245,7 +242,6 @@ export class InternalGraphQLAPIClass {
* @param operation
*/
getGraphqlOperationType(operation: GraphQLOperation): OperationTypeNode {
debugger;
const doc = parse(operation);
const definitions =
doc.definitions as ReadonlyArray<OperationDefinitionNode>;
Expand All @@ -268,7 +264,6 @@ export class InternalGraphQLAPIClass {
additionalHeaders?: { [key: string]: string },
customUserAgentDetails?: CustomUserAgentDetails
): Observable<GraphQLResult<T>> | Promise<GraphQLResult<T>> {
debugger;
// TODO: Could retrieve headers and config here. Call post method.
const query =
typeof paramQuery === 'string'
Expand Down Expand Up @@ -326,7 +321,6 @@ export class InternalGraphQLAPIClass {
initParams = {},
customUserAgentDetails?: CustomUserAgentDetails
): Promise<GraphQLResult<T>> {
debugger;
this.createInstanceIfNotCreated();
const {
aws_appsync_region: region,
Expand Down
11 changes: 7 additions & 4 deletions packages/api/src/internals/InternalAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ export class InternalAPIClass {
this._graphqlApi.Cache = this.Cache;
// this._graphqlApi.Credentials = this.Credentials;

// TODO V6
// @ts-ignore
const restAPIConfig = this._restApi.configure(this._options);
// TODO V6 - `Amplify.getConfig` for REST?
// const restAPIConfig = Amplify.getConfig().RestApi;

// V5:
// const restAPIConfig = this._restApi.configure(this._options);
const graphQLAPIConfig = this._graphqlApi.configure(this._options);

return { ...restAPIConfig, ...graphQLAPIConfig };
// return { ...restAPIConfig, ...graphQLAPIConfig };
return { ...graphQLAPIConfig };
}

/**
Expand Down

0 comments on commit 9929d33

Please sign in to comment.