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

updated fastify plugin to work with fastify v5 #2669

Merged
merged 3 commits into from
Oct 12, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/experimental-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
NODE_VERSION: 18
NODE_VERSION: 22
# NODE_OPTIONS: --openssl-legacy-provider

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Deploy to Firebase Hosting on merge
- master

env:
NODE_VERSION: 18
NODE_VERSION: 22
# NODE_OPTIONS: --openssl-legacy-provider

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Deploy to Firebase Hosting on PR
'on': pull_request

env:
NODE_VERSION: 18
NODE_VERSION: 22
# NODE_OPTIONS: --openssl-legacy-provider

jobs:
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ on:
- master

env:
NODE_VERSION: 18
NODE_VERSION: 22
# NODE_OPTIONS: --openssl-legacy-provider

jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- run: yarn --frozen-lockfile --network-timeout 1000000
- run: yarn build:ci
- name: Deploy to translate surge.sh
uses: dswistowski/surge-sh-action@v1
with:
domain: altair-gql-translate.surge.sh
project: ./packages/altair-app/dist
login: ${{ secrets.surge_login }}
token: ${{ secrets.surge_token }}
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- run: yarn --frozen-lockfile --network-timeout 1000000
- run: yarn build:ci
- name: Deploy to translate surge.sh
uses: dswistowski/surge-sh-action@v1
with:
domain: altair-gql-translate.surge.sh
project: ./packages/altair-app/dist
login: ${{ secrets.surge_login }}
token: ${{ secrets.surge_token }}
# todo:
# runs-on: ubuntu-latest
# steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# v*.*.*

env:
NODE_VERSION: 18
NODE_VERSION: 22
# NODE_OPTIONS: --openssl-legacy-provider

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
NODE_VERSION: 18
NODE_VERSION: 22
# NODE_OPTIONS: --openssl-legacy-provider

# TODO: Handle browser extension release
Expand Down
26 changes: 26 additions & 0 deletions examples/fastify-v5/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { AltairFastify } from '../../packages/altair-fastify-plugin/dist';

// const Fastify = require("fastify");
import Fastify from 'fastify';
// const AltairFastify = require("altair-fastify-plugin");
// import AltairFastify from 'altair-fastify-plugin';

const app = Fastify();

// ...

app.register(AltairFastify, {
/**
* All these are the defaults.
*/
path: '/altair',
baseURL: '/altair/',
endpointURL: '/graphql',
});

// ...

// Altair available at localhost:3000/altair
app.listen({ port: 3000 }, () => {
console.log('Server listening at http://localhost:3000');
});
17 changes: 17 additions & 0 deletions examples/fastify-v5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "fastify-v4",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@types/node": "^22.7.4",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
},
"dependencies": {
"fastify": "^5.0.0"
},
"scripts": {
"start": "ts-node index.ts"
}
}
Loading
Loading