Skip to content
Closed
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
8 changes: 4 additions & 4 deletions packages/apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"@apollo/gateway": "2.3.3",
"@apollo/server": "4.7.4",
"@apollo/server-plugin-response-cache": "4.1.0",
"@apollo/subgraph": "2.2.3",
"@apollo/subgraph": "2.4.9",
"@as-integrations/fastify": "2.0.0",
"@nestjs/common": "10.0.5",
"@nestjs/core": "10.0.5",
"@nestjs/platform-express": "10.0.5",
"@nestjs/platform-fastify": "10.0.5",
"@nestjs/testing": "10.0.5",
"apollo-cache-inmemory": "1.6.6",
"apollo-client": "2.6.10",
"apollo-link-ws": "1.0.20"
"@apollo/client": "3.7.17",
"subscriptions-transport-ws": "0.11.0",
"graphql-ws": "5.14.0"
},
"dependencies": {
"@apollo/server-plugin-landing-page-graphql-playground": "4.0.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/apollo/tests/subscriptions/compat.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { InMemoryCache } from 'apollo-cache-inmemory';
import ApolloClient from 'apollo-client';
import { WebSocketLink } from 'apollo-link-ws';
import { ApolloClient, InMemoryCache } from '@apollo/client/core';
import { gql } from 'graphql-tag';
import { Client, createClient } from 'graphql-ws';
import { SubscriptionClient } from 'subscriptions-transport-ws';
import * as ws from 'ws';
import { AppModule } from './app/app.module';
import { pubSub } from './app/notification.resolver';
import { GraphQLWsLink } from './utils/graphql-ws.link';
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
import { WebSocketLink } from '@apollo/client/link/ws';

const subscriptionQuery = gql`
subscription TestSubscription($id: String!) {
Expand Down
12 changes: 8 additions & 4 deletions packages/apollo/tests/subscriptions/graphql-ws.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { InMemoryCache } from 'apollo-cache-inmemory';
import ApolloClient, { ApolloError } from 'apollo-client';
import { ApolloClient, ApolloError, InMemoryCache } from '@apollo/client/core';
import { gql } from 'graphql-tag';
import { Client, Context, createClient } from 'graphql-ws';
import * as ws from 'ws';
import { AppModule } from './app/app.module';
import { pubSub } from './app/notification.resolver';
import { GraphQLWsLink } from './utils/graphql-ws.link';
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
import { MalformedTokenException } from './utils/malformed-token.exception';

const subscriptionQuery = gql`
Expand Down Expand Up @@ -37,7 +36,12 @@ describe('graphql-ws protocol', () => {
},
subscriptions: {
'graphql-ws': {
onConnect: (context: Context<any>) => {
onConnect: (
context: Context<
any,
{ socket: { close: (number, string) => any | boolean } }
>,
) => {
Comment on lines +39 to +44
Copy link
Copy Markdown
Contributor Author

@erikwrede erikwrede Jul 11, 2023

Choose a reason for hiding this comment

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

Did this to fix the typescript errors, if anyone can point me towards the right type that is used here, I'm happy to adjust this line, IMO using any, just like upstream, here is sufficient for the tests though.

if (!context.connectionParams.authorization) {
return context.extra.socket.close(
4000,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { InMemoryCache } from 'apollo-cache-inmemory';
import ApolloClient, { ApolloError } from 'apollo-client';
import { WebSocketLink } from 'apollo-link-ws';
import { gql } from 'graphql-tag';
import { ApolloClient, ApolloError, InMemoryCache } from '@apollo/client/core';
import { WebSocketLink } from '@apollo/client/link/ws';
import { SubscriptionClient } from 'subscriptions-transport-ws';
import { gql } from 'graphql-tag';
import * as ws from 'ws';
import { AppModule } from './app/app.module';
import { pubSub } from './app/notification.resolver';
Expand Down Expand Up @@ -65,7 +64,6 @@ describe('subscriptions-transport-ws protocol', () => {
},
ws,
);

const apolloClient = new ApolloClient({
link: new WebSocketLink(wsClient),
cache: new InMemoryCache(),
Expand Down
26 changes: 0 additions & 26 deletions packages/apollo/tests/subscriptions/utils/graphql-ws.link.ts

This file was deleted.

Loading