Skip to content

Commit

Permalink
removed the newly added exception for missing endpoint for now; lots
Browse files Browse the repository at this point in the history
 of testing depends on creating appsync connections to nowhere
  • Loading branch information
Jon Wire committed Dec 18, 2024
1 parent e61d28d commit 27123f5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/api-graphql/src/internals/InternalGraphQLAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,17 +386,14 @@ export class InternalGraphQLAPIClass {

const appSyncGraphqlEndpoint = endpoint ?? config?.endpoint;

if (!appSyncGraphqlEndpoint) {
throw new Error(
'Endpoint missing from subscription query. An endpoint must either be configured or provided at the call site.',
);
}

// TODO: This could probably be an exception. But, lots of tests rely on
// attempting to connect to nowhere. So, I'm treating as the opposite of
// a Chesterton's fence for now. (A fence I shouldn't build, because I don't
// know why somethings depends on its absence!)
const memoKey = appSyncGraphqlEndpoint ?? 'none';
const realtimeProvider =
this.appSyncRealTime.get(appSyncGraphqlEndpoint!) ??
new AWSAppSyncRealTimeProvider();

this.appSyncRealTime.set(appSyncGraphqlEndpoint, realtimeProvider);
this.appSyncRealTime.get(memoKey) ?? new AWSAppSyncRealTimeProvider();
this.appSyncRealTime.set(memoKey, realtimeProvider);

return realtimeProvider
.subscribe(
Expand Down

0 comments on commit 27123f5

Please sign in to comment.