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

chore(deps): update dependency graphql-sse to v2 #4919

Merged
merged 2 commits into from
Dec 27, 2022

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 20, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
graphql-sse 1.3.2 -> 2.0.0 age adoption passing confidence

Release Notes

enisdenjo/graphql-sse

v2.0.0

Compare Source

Features
  • handler: Server and environment agnostic handler (#​37) (22cf03d)
BREAKING CHANGES
  • handler: The handler is now server agnostic and can run anywhere
  • Core of graphql-sse is now server agnostic and as such offers a handler that implements a generic request/response model
  • Handler does not await for whole operation to complete anymore. Only the processing part (parsing, validating and executing)
  • GraphQL context is now typed
  • Hook arguments have been changed, they're not providing the Node native req/res anymore - they instead provide the generic request/response
  • onSubscribe hook can now return an execution result too (useful for caching for example)
  • Throwing in onNext and onComplete hooks will bubble the error to the returned iterator
Migration

Even though the core of graphql-sse is now completely server agnostic, there are adapters to ease the integration with existing solutions. Migrating is actually not a headache!

Beware that the adapters don't handle internal errors, it's your responsibility to take care of that and behave accordingly.

http
import http from 'http';
- import { createHandler } from 'graphql-sse';
+ import { createHandler } from 'graphql-sse/lib/use/http';

// Create the GraphQL over SSE handler
const handler = createHandler({ schema });

// Create an HTTP server using the handler on `/graphql/stream`
const server = http.createServer((req, res) => {
  if (req.url.startsWith('/graphql/stream')) {
    return handler(req, res);
  }
  res.writeHead(404).end();
});

server.listen(4000);
console.log('Listening to port 4000');
http2
import fs from 'fs';
import http2 from 'http2';
- import { createHandler } from 'graphql-sse';
+ import { createHandler } from 'graphql-sse/lib/use/http2';

// Create the GraphQL over SSE handler
const handler = createHandler({ schema });

// Create an HTTP server using the handler on `/graphql/stream`
const server = http.createServer((req, res) => {
  if (req.url.startsWith('/graphql/stream')) {
    return handler(req, res);
  }
  res.writeHead(404).end();
});

server.listen(4000);
console.log('Listening to port 4000');
express
import express from 'express'; // yarn add express
- import { createHandler } from 'graphql-sse';
+ import { createHandler } from 'graphql-sse/lib/use/express';

// Create the GraphQL over SSE handler
const handler = createHandler({ schema });

// Create an express app
const app = express();

// Serve all methods on `/graphql/stream`
app.use('/graphql/stream', handler);

server.listen(4000);
console.log('Listening to port 4000');
fastify
import Fastify from 'fastify'; // yarn add fastify
- import { createHandler } from 'graphql-sse';
+ import { createHandler } from 'graphql-sse/lib/use/fastify';

// Create the GraphQL over SSE handler
const handler = createHandler({ schema });

// Create a fastify app
const fastify = Fastify();

// Serve all methods on `/graphql/stream`
fastify.all('/graphql/stream', handler);

fastify.listen({ port: 4000 });
console.log('Listening to port 4000');

1.3.2 (2022-12-06)

Bug Fixes
  • handler: Correct typings and support for http2 (08d6ca3), closes #​38

1.3.1 (2022-12-05)

Bug Fixes
  • client: Abort request when reporting error (91057bd)
  • client: Operation requests are of application/json content-type (0084de7)

Configuration

📅 Schedule: Branch creation - "after 8pm,before 8:00am" in timezone Europe/Warsaw, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Dec 20, 2022
@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2022

⚠️ No Changeset found

Latest commit: 30bd669

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@renovate renovate bot force-pushed the renovate/graphql-sse-2.x branch 7 times, most recently from b18e8b9 to 37be1d1 Compare December 24, 2022 23:13
@renovate renovate bot force-pushed the renovate/graphql-sse-2.x branch from 37be1d1 to b4305aa Compare December 27, 2022 00:54
@ardatan ardatan requested a review from enisdenjo December 27, 2022 00:54
@renovate
Copy link
Contributor Author

renovate bot commented Dec 27, 2022

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@github-actions
Copy link
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/prisma-loader 7.2.49-alpha-20221227092251-af49b3cb npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.........................: 100.00% ✓ 144      ✗ 0  
     data_received..................: 17 MB   1.7 MB/s
     data_sent......................: 62 kB   6.1 kB/s
     http_req_blocked...............: avg=17.04µs  min=3.1µs    med=4.55µs   max=860.1µs  p(90)=5.98µs   p(95)=9.1µs   
     http_req_connecting............: avg=10.9µs   min=0s       med=0s       max=785.3µs  p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=131.5ms  min=107.93ms med=123.28ms max=265.57ms p(90)=157.56ms p(95)=179.59ms
       { expected_response:true }...: avg=131.5ms  min=107.93ms med=123.28ms max=265.57ms p(90)=157.56ms p(95)=179.59ms
     http_req_failed................: 0.00%   ✓ 0        ✗ 72 
     http_req_receiving.............: avg=267.44µs min=174.2µs  med=222.1µs  max=717.5µs  p(90)=418.62µs p(95)=467.99µs
     http_req_sending...............: avg=150.14µs min=21.7µs   med=35.45µs  max=2.73ms   p(90)=97.12µs  p(95)=971.36µs
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=131.08ms min=107.7ms  med=122.82ms max=265.03ms p(90)=156.63ms p(95)=179.35ms
     http_reqs......................: 72      7.179196/s
     iteration_duration.............: avg=139.24ms min=113.59ms med=130.62ms max=273.59ms p(90)=163.4ms  p(95)=186.39ms
     iterations.....................: 72      7.179196/s
     vus............................: 1       min=1      max=1
     vus_max........................: 1       min=1      max=1

@github-actions
Copy link
Contributor

🚀 Website Preview

The latest changes to the website are available as preview in: https://bf548d14.graphql-tools.pages.dev

@enisdenjo enisdenjo merged commit 30dcc7b into master Dec 27, 2022
@enisdenjo enisdenjo deleted the renovate/graphql-sse-2.x branch December 27, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant