release-1668505848434
版本发布时间: 2022-11-15 17:50:49
dotansimha/graphql-yoga最新发布版本:release-1723761948464(2024-08-16 06:45:48)
@graphql-yoga/apollo-link@1.0.0
Major Changes
Patch Changes
@graphql-yoga/urql-exchange@1.0.0
Major Changes
Patch Changes
@graphql-yoga/common@3.0.0
Major Changes
-
2e0c4824
Thanks @b4s36t4! - Drop Node 12 SupportGraphQL Yoga no longer supports Node 12 which is no longer an LTS version. GraphQL Yoga now needs Node 14 at least.
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/redis-event-target@1.0.0
Major Changes
-
#1761
b2407c6a
Thanks @ardatan! - - DropTypedEvent
in favor ofCustomEvent
- Use
@whatwg-node/events
as a ponyfill instead of@whatwg-node/fetch
- Use
Patch Changes
- Updated dependencies [
b2407c6a
]:- @graphql-yoga/typed-event-target@1.0.0
@graphql-yoga/typed-event-target@1.0.0
Major Changes
-
#1761
b2407c6a
Thanks @ardatan! - - DropTypedEvent
in favor ofCustomEvent
- Use
@whatwg-node/events
as a ponyfill instead of@whatwg-node/fetch
- Use
@graphql-yoga/graphiql@3.0.0
Major Changes
graphql-yoga@3.0.0
Major Changes
-
2e0c4824
Thanks @b4s36t4! - Drop Node 12 SupportGraphQL Yoga no longer supports Node 12 which is no longer an LTS version. GraphQL Yoga now needs Node 14 at least.
-
#2012
720898db
Thanks @saihaj! - Remove.inject
method to mock testing. Users should replace to usefetch
method for testing.Checkout our docs on testing https://www.the-guild.dev/graphql/yoga-server/v3/features/testing.
import { createYoga } from 'graphql-yoga' import { schema } from './schema' const yoga = createYoga({ schema }) - const { response, executionResult } = await yoga.inject({ - document: "query { ping }", - }) + const response = await yoga.fetch('http://yoga/graphql', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + query: 'query { ping }', + }), + }) + const executionResult = await response.json() console.assert(response.status === 200, 'Response status should be 200') console.assert(executionResult.data.ping === 'pong',`Expected 'pong'`)
-
#1753
eeaced00
Thanks @ardatan! -schema
no longer accepts an object oftypeDefs
andresolvers
but instead you can usecreateSchema
to create a GraphQL schema. -
#1516
209b1620
Thanks @ardatan! - Now it is possible to decide the returnedContent-Type
by specifying theAccept
header. So ifAccept
header hastext/event-stream
withoutapplication/json
, Yoga respects that returnstext/event-stream
instead ofapplication/json
. -
#1808
02d2aecd
Thanks @enisdenjo! - DropreadinessCheckEndpoint
in favor of theuseReadinessCheck
plugin -
#1473
c4b3a9c8
Thanks @ardatan! - ReplaceGraphQLYogaError
in favor ofGraphQLError
. -
#1660
71554172
Thanks @saihaj! - Update to the latest version of the envelopuseMaskedError
plugin.- Removed
handleValidationErrors
andhandleParseErrors
- Renamed
formatError
tomaskError
- Removed
-
#2091
1d508495
Thanks @ardatan! - Export only specific utilities from@envelop/core
.
Minor Changes
-
#1966
6e250209
Thanks @saihaj! - Use@graphql-tools/executor
as a default GraphQL Executor in favor ofgraphql-js
. -
#1497
1d7f810a
Thanks @ardatan! - Support a schema factory function that runs per request or a promise to be resolved before the first request.createYoga({ schema(request: Request) { return getSchemaForToken(request.headers.get('x-my-token')) } })
async function buildSchemaAsync() { const typeDefs = await fs.promises.readFile('./schema.graphql', 'utf8') const resolvers = await import('./resolvers.js') return makeExecutableSchema({ typeDefs, resolvers }) } createYoga({ schema: buildSchemaAsync() })
-
#1662
098e139f
Thanks @ardatan! - - Batching RFC support withbatchingLimit
option to enable batching with an exact limit of requests per batch.- New
onParams
hook that takes a singleGraphQLParams
object - Changes in
onRequestParse
andonRequestParseDone
hook - Now
onRequestParseDone
receives the exact object that is passed by the request parser so it can beGraphQLParams
or an array ofGraphQLParams
so useonParams
if you need to manipulate batched execution params individually.
- New
Patch Changes
-
#2024
9f991a27
Thanks @enisdenjo! - Ensure all parsing failures inGraphQLScalarType
are caught and handled with 400 status code. -
#1920
cebca219
Thanks @enisdenjo! - Handle edge case whereContent-Type
header provides a list like;Content-Type: application/json, text/plain, */*
-
#1609
74e1f830
Thanks @enisdenjo! -usePreventMutationViaGET
doesn't do assertion if it is notYogaContext
, so it is possible to use Yoga's Envelop instance with other server implementations likegraphql-ws
. -
#1567
e7a47b56
Thanks @n1ru4l! - Handle invalid POST body gracefully. Rejectnull
, non-object bodies or invalid JSON bodies. -
#1911
5f5b1160
Thanks @enisdenjo! - Handle cases where user supplies a malformed/unexpected context. Preventing GraphQL Yoga to crash and existing prematurely. -
73e56068
Thanks @ardatan! - Fix cancellation logic for defer/stream queries. -
#1609
74e1f830
Thanks @enisdenjo! - Expose readonlygraphqlEndpoint
inYogaServerInstance
const yoga = createYoga({ /*...*/ }) console.log(yoga.graphqlEndpoint) // /graphql by default
-
#1844
b079c93b
Thanks @ardatan! - All unexpected errors even if they are masked/wrapped The HTTP status code will be determined by the specific protocol the client is sending."Unexpected error." means an Error that is not an instance of GraphQLError or an instance of GraphQLError with an
originalError
that is not an instance of GraphQLError recursively. -
#1988
b19a9104
Thanks @ardatan! - Respect the order of mime types given in the accept header by the client. -
#1616
1d5cde96
Thanks @ardatan! - Allow the content typeapplication/graphql-response+json
as theAccept
header value. -
#1775
44878a5b
Thanks @enisdenjo! - Improve the context type for server and request context. -
Updated dependencies [
b2407c6a
]:- @graphql-yoga/subscription@3.0.0
@graphql-yoga/node@3.0.0
Major Changes
-
2e0c4824
Thanks @b4s36t4! - Drop Node 12 SupportGraphQL Yoga no longer supports Node 12 which is no longer an LTS version. GraphQL Yoga now needs Node 14 at least.
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-apollo-inline-trace@1.0.0
Major Changes
-
#1621
66b87b02
Thanks @enisdenjo! - Implementation of Apollo's federated inline tracing
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-apq@1.0.0
Major Changes
-
#1137
3eebe6f2
Thanks @ardatan! - New Persisted Operations Plugin. https://www.graphql-yoga.com/v3/features/persisted-operationsNew Automatic Persisted Queries Plugin. https://www.graphql-yoga.com/v3/features/automatic-persisted-queries
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-defer-stream@1.0.0
Patch Changes
-
73e56068
Thanks @ardatan! - Fix cancellation logic for defer/stream queries. -
Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-persisted-operations@1.0.0
Major Changes
-
#1137
3eebe6f2
Thanks @ardatan! - New Persisted Operations Plugin. https://www.graphql-yoga.com/v3/features/persisted-operationsNew Automatic Persisted Queries Plugin. https://www.graphql-yoga.com/v3/features/automatic-persisted-queries
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-prometheus@1.0.0
Major Changes
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-response-cache@1.0.0
Major Changes
-
#1359
5629a5cb
Thanks @ardatan! - New Response Cache Plugin!!!On top of
@envelop/response-cache
, this new plugin allows you to skip execution phase even before all the GraphQL execution phases immediately after the GraphQL request parameters is parsed by Yoga.Also it doesn't need to have
documentString
stored in somewhere in order to get it back during the execution to generate the cache key.All the features of the same except for the following:
-
session
factory function takesGraphQLParams
andRequest
objects instead of GraphQL context as arguments.-
type SessionIdFactory = (params: GraphQLParams, request: Request) => Maybe<string>
-
-
enabled
function takesGraphQLParams
andRequest
objects instead of GraphQL context as arguments.-
type EnabledFn = (params: GraphQLParams, request: Request) => boolean
-
-
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/plugin-sofa@1.0.0
Major Changes
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/render-graphiql@3.0.0
Patch Changes
- Updated dependencies [
2e0c4824
,8773a27f
,720898db
,9f991a27
,6e250209
,cebca219
,eeaced00
,74e1f830
,e7a47b56
,5f5b1160
,1d7f810a
,209b1620
,098e139f
,73e56068
,02d2aecd
,74e1f830
,c4b3a9c8
,b079c93b
,71554172
,b19a9104
,1d5cde96
,44878a5b
,1d508495
]:
@graphql-yoga/subscription@3.0.0
Major Changes
-
#1761
b2407c6a
Thanks @ardatan! - - DropTypedEvent
in favor ofCustomEvent
- Use
@whatwg-node/events
as a ponyfill instead of@whatwg-node/fetch
- Use
Patch Changes
- Updated dependencies [
b2407c6a
]:- @graphql-yoga/typed-event-target@1.0.0