Skip to content

Commit

Permalink
fastify-static & fastify-error & fastify-websocket -> @fastify/static…
Browse files Browse the repository at this point in the history
… & @fastify/error & @fastify/websocket (#792)
  • Loading branch information
jessekrubin authored May 6, 2022
1 parent b319067 commit 7978415
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
GraphQLScalarType,
ValidationRule,
} from "graphql";
import { SocketStream } from "fastify-websocket"
import { SocketStream } from "@fastify/websocket"
import { IncomingMessage, IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
import { Readable } from "stream";

Expand Down
2 changes: 1 addition & 1 deletion lib/errors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { formatError, GraphQLError } = require('graphql')
const createError = require('fastify-error')
const createError = require('@fastify/error')

class ErrorWithProps extends Error {
constructor (message, extensions, statusCode) {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { join } = require('path')
const Static = require('fastify-static')
const Static = require('@fastify/static')
const subscription = require('./subscription')
const { kRequestContext } = require('./symbols')
const sJSON = require('secure-json-parse')
Expand Down
6 changes: 3 additions & 3 deletions lib/subscription.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const fastifyWebsocket = require('fastify-websocket')
const fastifyWebsocket = require('@fastify/websocket')
const { assignLifeCycleHooksToContext, Hooks } = require('./hooks')
const { kHooks } = require('./symbols')
const SubscriptionConnection = require('./subscription-connection')
Expand Down Expand Up @@ -60,8 +60,8 @@ function createConnectionHandler ({ subscriber, fastify, onConnect, onDisconnect
module.exports = function (fastify, opts, next) {
const { getOptions, subscriber, verifyClient, onConnect, onDisconnect, lruGatewayResolvers, entityResolversFactory, subscriptionContextFn } = opts

// If `fastify.websocketServer` exists, it means `fastify-websocket` already registered.
// Without this check, fastify-websocket will be registered multiple times and raises FST_ERR_DEC_ALREADY_PRESENT.
// If `fastify.websocketServer` exists, it means `@fastify/websocket` already registered.
// Without this check, @fastify/websocket will be registered multiple times and raises FST_ERR_DEC_ALREADY_PRESENT.
if (fastify.websocketServer === undefined) {
fastify.register(fastifyWebsocket, {
options: {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
"wait-on": "^6.0.0"
},
"dependencies": {
"@fastify/error": "^2.0.0",
"@fastify/static": "^5.0.0",
"@fastify/websocket": "^5.0.0",
"@types/isomorphic-form-data": "^2.0.0",
"events.on": "^1.0.1",
"fastify-error": "^0.3.1",
"fastify-plugin": "^3.0.0",
"fastify-static": "^4.2.2",
"fastify-websocket": "^4.0.0",
"graphql": "^15.5.1",
"graphql-jit": "^0.7.0",
"mqemitter": "^4.4.1",
Expand Down
2 changes: 1 addition & 1 deletion test/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Fastify = require('fastify')
const WebSocket = require('ws')
const mq = require('mqemitter')
const { EventEmitter } = require('events')
const fastifyWebsocket = require('fastify-websocket')
const fastifyWebsocket = require('@fastify/websocket')
const GQL = require('..')

const FakeTimers = require('@sinonjs/fake-timers')
Expand Down

0 comments on commit 7978415

Please sign in to comment.