Skip to content

Commit

Permalink
Fix removing __typename when cursor is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Sep 21, 2023
1 parent 48b6488 commit 9f8b98a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/core/src/event-aggregator/gql-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,12 @@ export class GqlEventAggregatorService extends EventAggregatorService {
variables,
});

const {
__typename,
cursor: { __typename: cursorTypename, ...cursor },
...metadata
} = getLogEvents.metadata;
// Remove __typename from GQL query result
const { __typename, cursor, ...metadata } = getLogEvents.metadata;

if (cursor) {
delete cursor.__typename;
}

return {
events: getLogEvents.events.map((event: any) => ({
Expand Down

0 comments on commit 9f8b98a

Please sign in to comment.