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

fix(api): issue 12756 by exporting CONNECTION_STATE_CHANGE as a value #12757

Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion packages/api/__tests__/API.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ResourcesConfig } from 'aws-amplify';
import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
import { generateClient } from '@aws-amplify/api';
import { generateClient, CONNECTION_STATE_CHANGE } from '@aws-amplify/api';
import { AmplifyClassV6 } from '@aws-amplify/core';
// import { runWithAmplifyServerContext } from 'aws-amplify/internals/adapter-core';

Expand Down Expand Up @@ -38,6 +38,9 @@ describe('API generateClient', () => {
);
});

test('CONNECTION_STATE_CHANGE importable as a value, not a type', async () => {
expect(CONNECTION_STATE_CHANGE).toBe('ConnectionStateChange');
})
// test('server-side client.graphql', async () => {
// const config: ResourcesConfig = {
// API: {
Expand Down
3 changes: 2 additions & 1 deletion packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
export type {
GraphQLResult,
GraphQLReturnType,
CONNECTION_STATE_CHANGE,
} from '@aws-amplify/api-graphql';

export { CONNECTION_STATE_CHANGE } from '@aws-amplify/api-graphql';

import type { V6Client } from '@aws-amplify/api-graphql';

// explicitly defaulting to `never` here resolves
Expand Down
1 change: 1 addition & 0 deletions packages/aws-amplify/__tests__/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe('aws-amplify Exports', () => {
it('should only export expected symbols from the top level', () => {
expect(Object.keys(apiTopLevelExports).sort()).toEqual(
[
'CONNECTION_STATE_CHANGE',
'ConnectionState',
'GraphQLAuthError',
'del',
Expand Down
Loading