graphql-yoga
5.7.0
Minor Changes
-
#3331
5dae4ab
Thanks @EmrysMyrddin! - Expose server context inonResultProcessHook
. In particular, this gives access to thewaitUntil
method to cleanly handle hanging promises. -
#3331
5dae4ab
Thanks @EmrysMyrddin! - New hook: onExecutionResult which is triggered when an execution is done on the pipeline. If it is a batched operation, this is called per each operation in the batch -
#3331
5dae4ab
Thanks @EmrysMyrddin! - Expose the already existingwaitUntil
method from the server context.
Patch Changes
- #3331
5dae4ab
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.9.44
↗︎ (from^0.9.41
, independencies
)
- Updated dependency
5.6.3
Patch Changes
-
#3400
0866c1b
Thanks @n1ru4l! - Restores compatibility with RFC1341: The Multipart Content-Type by including preceding\r\n
for initial boundary delimiter when using the multipart response protocol.This makes Yoga compatible with libraries that strictly follow the response protocol, such as fetch-multipart-graphql.
5.6.2
Patch Changes
-
#3357
b7bf47b
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.9.41
↗︎ (from^0.9.40
, independencies
)
- Updated dependency
-
#3384
81a736b
Thanks @ardatan! - dependencies updates:- Updated dependency
@envelop/core@^5.0.1
↗︎ (from^5.0.0
, independencies
) - Updated dependency
@graphql-tools/executor@^1.3.0
↗︎ (from^1.2.5
, independencies
) - Updated dependency
@graphql-tools/schema@^10.0.4
↗︎ (from^10.0.0
, independencies
) - Updated dependency
@graphql-tools/utils@^10.3.2
↗︎ (from^10.1.0
, independencies
) - Updated dependency
@whatwg-node/fetch@^0.9.18
↗︎ (from^0.9.17
, independencies
) - Updated dependency
@whatwg-node/server@^0.9.40
↗︎ (from^0.9.36
, independencies
)
- Updated dependency
5.6.1
Patch Changes
- #3338
4252e3d
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.9.36
↗︎ (from^0.9.33
, independencies
)
- Updated dependency
5.6.0
Minor Changes
-
#3333
9f3f945
Thanks @ardatan! - By default, Yoga does not allow extra parameters in the request body other thanquery
,operationName
,extensions
, andvariables
, then throws 400 HTTP Error. This change adds a new option calledextraParamNames
to allow extra parameters in the request body.import { createYoga } from 'graphql-yoga' const yoga = createYoga({ /* other options */ extraParamNames: ['extraParam1', 'extraParam2'] }) const res = await yoga.fetch('/graphql', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ query: 'query { __typename }', extraParam1: 'value1', extraParam2: 'value2' }) }) console.assert(res.status === 200)
5.5.0
Minor Changes
-
#3332
0208024
Thanks @ardatan! - Customize the landing page by passing a custom renderer that returnsResponse
to thelandingPage
optionimport { createYoga } from 'graphql-yoga' const yoga = createYoga({ landingPage: ({ url, fetchAPI }) => { return new fetchAPI.Response( /* HTML */ ` <!doctype html> <html> <head> <title>404 Not Found</title> </head> <body> <h1>404 Not Found</h1> <p>Sorry, the page (${url.pathname}) you are looking for could not be found.</p> </body> </html> `, { status: 404, headers: { 'Content-Type': 'text/html' } } ) } })
5.4.0
Minor Changes
-
#3314
d5dfe99
Thanks @EmrysMyrddin! - Allow for full customization of the GraphiQL page.Props from the
YogaGraphiQL
are now forwarded to the underlying GraphiQL components.The
graphiql
option field type of the Yoga server as also been updated to document which options are configurable from the server side. Only serializable options are available. -
#3255
7335a82
Thanks @nissy-dev! - support shouldPersistHeaders option in GraphiQL plugin
Patch Changes
-
#3325
4cd43b9
Thanks @n1ru4l! - Fix TypeScript compatibility withtype: "module"
. -
#3300
fdd902c
Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
@graphql-yoga/logger@workspace:^
↗︎ (from^2.0.0
, independencies
) - Updated dependency
@graphql-yoga/subscription@workspace:^
↗︎ (from^5.0.0
, independencies
)
- Updated dependency
-
#3270
f9aa1cd
Thanks @andrew0! - Retain server context prototype for batched requests -
Updated dependencies [
fdd902c
]:- @graphql-yoga/subscription@5.0.1
5.3.1
Patch Changes
-
#3237
3324bbab
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.9.33
↗︎ (from^0.9.32
, independencies
)
- Updated dependency
-
#3237
3324bbab
Thanks @ardatan! - In such environments like CloudFlare Workers, therequest
object in the context always has the initial request object, so it was impossible to access the actualRequest
object from the execution context. Now Yoga ensures that therequest
in the context is the same with the actualRequest
.
5.3.0
Minor Changes
-
#3197
f775b341
Thanks @n1ru4l! - Experimental support for aborting GraphQL execution when the HTTP request is canceled.The execution of subsequent GraphQL resolvers is now aborted if the incoming HTTP request is canceled from the client side. This reduces the load of your API in case incoming requests with deep GraphQL operation selection sets are canceled.
import { createYoga, useExecutionCancellation } from 'graphql-yoga' const yoga = createYoga({ plugins: [useExecutionCancellation()] })
Action Required In order to benefit from this new feature, you need to update your integration setup for Fastify, Koa and Hapi.
- const response = await yoga.handleNodeRequest(req, { ... }) + const response = await yoga.handleNodeRequestAndResponse(req, res, { ... })
Please refer to the corresponding integration guides for examples.
Patch Changes
-
#3197
f775b341
Thanks @n1ru4l! - dependencies updates:- Updated dependency
@graphql-tools/executor@^1.2.5
↗︎ (from^1.2.2
, independencies
) - Updated dependency
@whatwg-node/fetch@^0.9.17
↗︎ (from^0.9.7
, independencies
) - Updated dependency
@whatwg-node/server@^0.9.32
↗︎ (from^0.9.1
, independencies
)
- Updated dependency
-
#3214
f89a1aa2
Thanks @n1ru4l! - Always include empty data payload for finalcomplete
event of SSE stream responses to ensureEventSource
compatibility. See the GraphQL over SSE protocol for more information.
5.2.0
Minor Changes
- #3196
71db7548
Thanks @n1ru4l! - Allow setting async iterable withinonParams
hooksetResult
function
Patch Changes
- #3196
71db7548
Thanks @n1ru4l! - dependencies updates:- Updated dependency
@graphql-tools/executor@^1.2.2
↗︎ (from^1.0.0
, independencies
) - Updated dependency
@graphql-tools/utils@^10.1.0
↗︎ (from^10.0.0
, independencies
)
- Updated dependency
5.1.1
Patch Changes
5.1.0
Minor Changes
5.0.2
Patch Changes
- #3133
77d107fe
Thanks @ardatan! - Update HTTP Executor and addmethod
anduseGETForQueries
to GraphiQL options
5.0.1
Patch Changes
3fea19f2
Thanks @antonio-iodice! - Do not return 404 when using query params or trailing slashes
5.0.0
Major Changes
-
#3063
01430e03
Thanks @EmrysMyrddin! - Breaking Change: Drop support of Node.js 16 -
#3070
5b615478
Thanks @renovate! - dependencies updates:- Updated dependency
@envelop/core@^5.0.0
↗︎ (from^4.0.0
, independencies
)
- Updated dependency
Patch Changes
-
#3051
350bb851
Thanks @ardatan! - Use the same context object in the entire pipeline -
Updated dependencies [
01430e03
]:- @graphql-yoga/subscription@5.0.0
- @graphql-yoga/logger@2.0.0
4.0.5
Patch Changes
- #3004
bf602edf
Thanks @EmrysMyrddin! - Fix dynamic schema function type and documentation
4.0.4
Patch Changes
- #2958
5f182006
Thanks @enisdenjo! - Start SSE stream with a ping
4.0.3
Patch Changes
5efb8250
Thanks @n1ru4l! - dependencies updates:- Updated dependency
@whatwg-node/fetch@^0.9.7
↗︎ (from^0.9.0
, independencies
) - Updated dependency
@whatwg-node/server@^0.9.1
↗︎ (from^0.8.1
, independencies
)
- Updated dependency
4.0.2
Patch Changes
- #2872
ce6d2465
Thanks @nescalante! - Avoid overriding http status on extensions when using a plugin that modifies error prop
4.0.1
Patch Changes
-
#2866
bb739b05
Thanks @renovate! - dependencies updates:- Updated dependency
lru-cache@^10.0.0
↗︎ (from^9.0.0
, independencies
)
- Updated dependency
-
#2869
8f7d7abc
Thanks @enisdenjo! - Properly serialise GraphQLError on graphql-js v15
4.0.0
Major Changes
-
#2767
4228c1d5
Thanks @renovate! - Drop support for Node.js 14. Require Node.js>=16
. -
#2776
34ecb4bb
Thanks @enisdenjo! - Drop unused graphiql optionsdefaultVariableEditorOpen
andheaderEditorEnabled
-
#2810
ec318fe6
Thanks @n1ru4l! - Remove support for executing Subscription operations over the incremental delivery response protocol (multipart/mixed
) -
#2775
dd699c4b
Thanks @enisdenjo! - Subscriptions use GraphQL over SSE “distinct connections mode” -
#2767
4228c1d5
Thanks @renovate! - Events without an event payload will now always havenull
as the event payload instead ofundefined
. -
#2777
0522c740
Thanks @enisdenjo! - Parse and validation cache are now under a single optionparserAndValidationCache
Patch Changes
-
#2720
cc370691
Thanks @n1ru4l! - Skip validation caching when there is noschema
specified. This previously caused a cryptic error message when reaching execution/validation without a schema. Now the missing schema error will actually originate from within thevalidate
function instead. -
#2726
b309ca0d
Thanks @ardatan! - RespecttoJSON
in the thrown errors. -
Updated dependencies [
4228c1d5
,4228c1d5
]:- @graphql-yoga/subscription@4.0.0
- @graphql-yoga/logger@1.0.0
3.9.1
Patch Changes
-
#2682
e1a60e21
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@^0.0.17
↗︎ (from^0.0.16
, independencies
)
- Updated dependency
-
#2686
c50ea51c
Thanks @n1ru4l! - dependencies updates:- Updated dependency
@graphql-tools/executor@^0.0.18
↗︎ (from^0.0.17
, independencies
) - Updated dependency
@graphql-tools/schema@^9.0.18
↗︎ (from^9.0.0
, independencies
)
- Updated dependency
-
#2686
c50ea51c
Thanks @n1ru4l! - Prevent errors thrown from subscription source crashing the Node.js process and instead log the error to the console, then terminate the client subscription.
3.9.0
Minor Changes
- #2675
aff69200
Thanks @enisdenjo! - Only well-formatted GraphQL-over-HTTP requests use 200 when accepting application/json
3.8.1
Patch Changes
-
#2652
ebb65b14
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@^0.0.16
↗︎ (from^0.0.15
, independencies
)
- Updated dependency
-
#2676
528941cb
Thanks @n1ru4l! - Prefercontent-type: multipart/mixed
overcontent-type: text/event-stream
when the client sendsaccept: text/event-stream, multipart/mixed
.
3.8.0
Minor Changes
- #2445
09d23a4b
Thanks @ardatan! - GraphQL SSE Distinct Connections mode support withlegacySse = false
flag
Patch Changes
-
#2602
99b72696
Thanks @n1ru4l! - dependencies updates:- Updated dependency
lru-cache@^7.14.1
↗︎ (from^8.0.0
, independencies
)
- Updated dependency
-
#2602
99b72696
Thanks @n1ru4l! - revertlru-cache
version to7.x.x
, as8.x.x
broke Node.js 14 support.
3.7.3
Patch Changes
- #2559
46e75917
Thanks @renovate! - dependencies updates:- Updated dependency
lru-cache@^8.0.0
↗︎ (from^7.14.1
, independencies
)
- Updated dependency
3.7.2
Patch Changes
- #2528
7ad50529
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-yoga/logger@^0.0.1
↗︎ (from0.0.1
, independencies
) - Updated dependency
@whatwg-node/server@^0.7.3
↗︎ (from^0.7.1
, independencies
)
- Updated dependency
3.7.1
Patch Changes
-
#2481
9fdd94b5
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/server@^0.7.1
↗︎ (from^0.6.7
, independencies
)
- Updated dependency
-
#2496
47b1c4a4
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@^0.0.15
↗︎ (from^0.0.14
, independencies
)
- Updated dependency
-
#2527
02ac055c
Thanks @ardatan! - dependencies updates:- Added dependency
@graphql-yoga/logger@0.0.0
↗︎ (todependencies
)
- Added dependency
-
Updated dependencies [
02ac055c
]:- @graphql-yoga/logger@0.0.1
3.7.0
Minor Changes
Patch Changes
-
#2470
23d1b26c
Thanks @n1ru4l! - dependencies updates:- Updated dependency
@envelop/validation-cache@^5.1.2
↗︎ (from^5.0.5
, independencies
)
- Updated dependency
-
#2470
23d1b26c
Thanks @n1ru4l! - bump range of@envelop/validation-cache
for fixing javascript runtime compatibility (usage of node-only globalrequire
).
3.6.1
Patch Changes
3c8c8434
Thanks @ardatan! - Replace LRU caching with lazy URL construction, avoid unnecessaryparse
andvalidate
invocation and CORS
3.6.0
Minor Changes
- #2393
790330be
Thanks @ardatan! - Decrease request latency by improving the validation and parser cache algorithm.
Patch Changes
-
#2388
6bc1410f
Thanks @ardatan! - Improve URL parsing performance -
#2375
ddb2607d
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@0.0.13
↗︎ (from0.0.12
, independencies
)
- Updated dependency
-
#2388
6bc1410f
Thanks @ardatan! - dependencies updates:- Added dependency
lru-cache@^7.14.1
↗︎ (todependencies
)
- Added dependency
-
#2392
1caac99b
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/fetch@0.6.8
↗︎ (from0.6.5
, independencies
) - Updated dependency
@whatwg-node/server@0.6.3
↗︎ (from0.5.11
, independencies
)
- Updated dependency
-
#2393
790330be
Thanks @ardatan! - dependencies updates:- Updated dependency
@graphql-tools/utils@^9.2.1
↗︎ (from^9.0.1
, independencies
) - Removed dependency
@envelop/parser-cache@^5.0.4
↗︎ (fromdependencies
)
- Updated dependency
-
#2394
7587d5c5
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@^0.0.14
↗︎ (from^0.0.13
, independencies
)
- Updated dependency
-
#2405
cc0d3899
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/fetch@^0.7.0
↗︎ (from^0.6.9
, independencies
) - Updated dependency
@whatwg-node/server@^0.6.5
↗︎ (from^0.6.4
, independencies
)
- Updated dependency
-
#2411
a747d249
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/fetch@^0.8.1
↗︎ (from^0.7.0
, independencies
) - Updated dependency
@whatwg-node/server@^0.6.7
↗︎ (from^0.6.5
, independencies
)
- Updated dependency
-
#2417
2933fc89
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/fetch@^0.7.1
↗︎ (from^0.7.0
, independencies
)
- Updated dependency
-
#2421
543e490b
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/fetch@^0.8.1
↗︎ (from^0.7.1
, independencies
) - Updated dependency
@whatwg-node/server@^0.6.7
↗︎ (from^0.6.5
, independencies
)
- Updated dependency
3.5.1
Patch Changes
3.5.0
Minor Changes
-
#2364
03597a5a
Thanks @n1ru4l! - export the yoga default format error function.import { createYoga, maskError } from 'graphql-yoga' const yoga = createYoga({ maskedErrors: { maskError(error, message, isDev) { if (error?.extensions?.code === 'DOWNSTREAM_SERVICE_ERROR') { return error } return maskError(error, message, isDev) } } })
3.4.1
Patch Changes
-
#2254
00843174
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/fetch@0.6.5
↗︎ (from0.6.2
, independencies
) - Updated dependency
@whatwg-node/server@0.5.11
↗︎ (from0.5.8
, independencies
)
- Updated dependency
-
#2254
00843174
Thanks @ardatan! - Use the new fetch implementation
3.4.0
Patch Changes
-
#2331
76c1ecb9
Thanks @enisdenjo! - Properly serialise response extension arrays, nullish values and dates -
#2276
8cd8b5a5
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@0.5.5
↗︎ (from0.5.4
, independencies
)
- Updated dependency
-
#2313
6e8bddba
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/fetch@0.6.2
↗︎ (from0.6.1
, independencies
) - Updated dependency
@whatwg-node/server@0.5.6
↗︎ (from0.5.5
, independencies
)
- Updated dependency
-
#2316
6ee252db
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@0.0.12
↗︎ (from0.0.11
, independencies
)
- Updated dependency
-
#2335
8f139e15
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@0.5.7
↗︎ (from0.5.6
, independencies
)
- Updated dependency
-
#2340
9beef914
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@0.5.8
↗︎ (from0.5.7
, independencies
)
- Updated dependency
-
#2240
c46d75e8
Thanks @enisdenjo! - Check HTTP request method after user-land plugins -
#2278
f9ab8a70
Thanks @ardatan! - Use normalized URL instead of string -
Updated dependencies [
fe4a2aca
]:- @graphql-yoga/subscription@3.1.0
3.3.1
Patch Changes
3.3.0
Minor Changes
Patch Changes
-
#2266
3e5f688f
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/fetch@0.6.1
↗︎ (from0.5.4
, independencies
) - Updated dependency
@whatwg-node/server@0.5.3
↗︎ (from0.5.1
, independencies
)
- Updated dependency
-
#2269
8b288a23
Thanks @renovate! - dependencies updates:- Updated dependency
@whatwg-node/server@0.5.4
↗︎ (from0.5.3
, independencies
)
- Updated dependency
3.2.1
Patch Changes
3.2.0
Minor Changes
Patch Changes
-
#2213
a86aaa0f
Thanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/executor@0.0.11
↗︎ (from0.0.9
, independencies
) - Updated dependency
@whatwg-node/fetch@0.5.4
↗︎ (from0.5.3
, independencies
) - Updated dependency
@whatwg-node/server@0.5.1
↗︎ (from0.4.17
, independencies
)
- Updated dependency
-
#2250
82f58934
Thanks @ardatan! - More accurate HTTP status code when unsupported media type is sent as a request body.Before it was returning
400: Bad Request
withRequest is not valid
text body in the response but now it returns415: Unsupported Media Type
with an empty body.Also see this unit test; https://github.com/dotansimha/graphql-yoga/pull/2250/files#diff-78bcfa5f6d33aceeabdacd26e353641fea6fd125838ed0e1565762221568c777R380
3.1.2
Patch Changes
-
#2231
c5b1cc46
Thanks @n1ru4l! - dependencies updates:- Updated dependency
@envelop/parser-cache@^5.0.4
↗︎ (from5.0.4
, independencies
) - Updated dependency
@envelop/validation-cache@^5.0.5
↗︎ (from5.0.4
, independencies
)
- Updated dependency
-
#2238
c152105e
Thanks @ardatan! - Do not call CORS headers factory twice -
#2206
26d780cd
Thanks @ardatan! - Correct Mask Error Factory signature -
#2239
d2958781
Thanks @davidruisinger! - Add content-length: 0 header if 204 is returned by OPTIONS request
3.1.1
Patch Changes
3.1.0
Minor Changes
Patch Changes
-
#2165
86fe453c
Thanks @ardatan! - ExportuseErrorHandler
to revert the unexpected breaking change -
#2145
ea81e1dd
Thanks @n1ru4l! - Avoid unnecessary iteration within internals
3.0.3
Patch Changes
- #2156
491ef5da
Thanks @renovate! - dependencies updates:- Updated dependency
@envelop/core@3.0.4
↗︎ (from3.0.3
, independencies
) - Updated dependency
@envelop/parser-cache@5.0.4
↗︎ (from5.0.3
, independencies
) - Updated dependency
@envelop/validation-cache@5.0.4
↗︎ (from5.0.3
, independencies
)
- Updated dependency
3.0.2
Patch Changes
-
#2154
0007c58d
Thanks @ardatan! - Only Yoga’s errors are now 200 when content-type is application/json -
#2147
39a8fe89
Thanks @ardatan! - Bump @whatwg-node/server to fix the conflict issue between webworker & dom TS typing libs
3.0.1
Patch Changes
- #2125
d63fe841
Thanks @enisdenjo! - application/json is the default when accept is missing until watershed
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
3.0.0-next.12
Patch Changes
3.0.0-next.11
Major Changes
-
#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://localhost:4000/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'`)
Patch Changes
-
#2024
9f991a27
Thanks @enisdenjo! - Ensure all parsing failures inGraphQLScalarType
are caught and handled with 400 status code. -
#2058
ef191eee
Thanks @enisdenjo! - Simplify landing page and fix links
3.0.0-next.10
Patch Changes
-
#1997
8773a27f
Thanks @saihaj! - introduce a new plugin for defer and stream instead of making it default in yoga -
#1996
cedde92f
Thanks @enisdenjo! - Support older version of GraphQLjs -
#1992
bf69a561
Thanks @saihaj! - inline functions to support multiple version of graphql-js
3.0.0-next.9
Minor Changes
Patch Changes
- #1988
b19a9104
Thanks @ardatan! - Respect the order of mime types given in the accept header by the client
3.0.0-next.8
Minor Changes
3.0.0-next.7
Patch Changes
-
#1920
cebca219
Thanks @enisdenjo! - Handle edge case where Content-Type header provides a list -
#1911
5f5b1160
Thanks @enisdenjo! - Handle cases where user supplies a malformed/unexpected context
3.0.0-next.6
Patch Changes
3.0.0-next.5
Major Changes
-
#1660
71554172
Thanks @saihaj! - update to EnvelopuseMaskedError
plugin- Removed handleValidationErrors and handleParseErrors
- Renamed formatError to maskError
Checkout envelop docs for more details https://www.the-guild.dev/graphql/envelop/v3/guides/migrating-from-v2-to-v3#8-update-options-for-usemaskederrors-plugin
3.0.0-next.4
Major Changes
- #1808
02d2aecd
Thanks @enisdenjo! - DropreadinessCheckEndpoint
and introduceuseReadinessCheck
plugin
Patch Changes
-
#1844
b079c93b
Thanks @ardatan! - - All unexpected errors even if they are masked/wrapped, HTTP status code will be set to 500.“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.
3.0.0-next.3
Patch Changes
3.0.0-next.2
Patch Changes
-
#1794
8c674c36
Thanks @ardatan! - dependencies updates:- Updated dependency
@whatwg-node/fetch@0.4.6
↗︎ (from0.4.5
, independencies
) - Updated dependency
@whatwg-node/server@0.4.10
↗︎ (from0.4.7
, independencies
) - Added dependency
@graphql-tools/utils@8.12.0
↗︎ (todependencies
)
- Updated dependency
3.0.0-next.1
Patch Changes
- #1775
44878a5b
Thanks @enisdenjo! - Context typings improvements
3.0.0-next.0
Major Changes
-
#1660
2e0c4824
Thanks @saihaj! - 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.
-
#1660
f46addd7
Thanks @saihaj! - See the migration guide for more information; -
#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
. -
#1473
c4b3a9c8
Thanks @ardatan! - BREAKING: RemoveGraphQLYogaError
in favor ofGraphQLError
Check the documentation to see how to useGraphQLError
Minor Changes
-
#1610
f4b23387
Thanks @ardatan! - Pass the parsed request as-is and validate the final GraphQLParams in useCheckGraphQLParams -
#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.
- Now
- New
Patch Changes
-
#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
- Reject non-object body - Reject invalid JSON body -
#1609
74e1f830
Thanks @enisdenjo! - Expose readonlygraphqlEndpoint
inYogaServerInstance
const yoga = createYoga({ /*...*/ }) console.log(yoga.graphqlEndpoint) // /graphql by default
-
#1616
1d5cde96
Thanks @ardatan! - Supportapplication/graphql-response+json
asAccept
ed content type for the response -
Updated dependencies [
b2407c6a
]:- @graphql-yoga/subscription@3.0.0-next.0
2.13.11
Patch Changes
- Updated dependencies []:
- @graphql-yoga/node@2.13.11
2.13.10
Patch Changes
- Updated dependencies
[
779b55ee
]:- @graphql-yoga/node@2.13.10
2.13.9
Patch Changes
- Updated dependencies []:
- @graphql-yoga/node@2.13.9
2.13.8
Patch Changes
- Updated dependencies []:
- @graphql-yoga/node@2.13.8
2.13.7
Patch Changes
2.13.6
Patch Changes
- eecf24c: Fix CommonJS TypeScript resolution with
moduleResolution
node16
ornodenext
- Updated dependencies [eecf24c]
- @graphql-yoga/node@2.13.6
2.13.5
Patch Changes
- Updated dependencies [c00dad3]
- @graphql-yoga/node@2.13.5
2.13.4
Patch Changes
- @graphql-yoga/node@2.13.4
2.13.3
Patch Changes
- Updated dependencies [639607d]
- @graphql-yoga/node@2.13.3
2.13.2
Patch Changes
- @graphql-yoga/node@2.13.2
2.13.1
Patch Changes
- @graphql-yoga/node@2.13.1
2.13.0
Patch Changes
- @graphql-yoga/node@2.13.0
2.12.0
Patch Changes
- @graphql-yoga/node@2.12.0
2.11.2
Patch Changes
- Updated dependencies [ca5f940]
- @graphql-yoga/node@2.11.2
2.11.1
Patch Changes
- Updated dependencies [9248df8]
- @graphql-yoga/node@2.11.1
2.11.0
Patch Changes
- Updated dependencies [8947657]
- @graphql-yoga/node@2.11.0
2.10.0
Minor Changes
- 7de07cd: Support TypeScript ECMA script resolution. More information on https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js
Patch Changes
- Updated dependencies [7de07cd]
- Updated dependencies [8922c3b]
- @graphql-yoga/node@2.10.0
2.9.2
Patch Changes
- @graphql-yoga/node@2.9.2
2.9.1
Patch Changes
- @graphql-yoga/node@2.9.1
2.9.0
Patch Changes
- Updated dependencies [06652c7]
- Updated dependencies [2d3c54c]
- @graphql-yoga/node@2.9.0
2.8.0
Patch Changes
- @graphql-yoga/node@2.8.0
2.7.0
Patch Changes
- @graphql-yoga/node@2.7.0
2.6.1
Patch Changes
- Updated dependencies [0224bf9]
- @graphql-yoga/node@2.6.1
2.6.0
Patch Changes
- @graphql-yoga/node@2.6.0
2.5.0
Patch Changes
- Updated dependencies [8b6d896]
- @graphql-yoga/node@2.5.0
2.4.1
Patch Changes
- @graphql-yoga/node@2.4.1
2.4.0
Patch Changes
- Updated dependencies [28e24c3]
- Updated dependencies [13f96db]
- @graphql-yoga/node@2.4.0
2.3.0
Patch Changes
- @graphql-yoga/node@2.3.0
2.2.1
Patch Changes
- Updated dependencies [32e2e40]
- @graphql-yoga/node@2.2.1
2.2.0
Patch Changes
- Updated dependencies [1d4fe42]
- @graphql-yoga/node@2.2.0
2.1.0
Patch Changes
- Updated dependencies [4077773]
- Updated dependencies [2739db2]
- Updated dependencies [cd9394e]
- @graphql-yoga/node@2.1.0
2.0.0
Major Changes
-
b6dd3f1: The goal is to provide a fully-featured, simple to set up, performant and extendable server. Some key features:
- GraphQL-over-HTTP spec compliant
- Extend the GraphQL request flow using
envelop
- File uploads (via GraphQL multipart request specification)
- GraphQL Subscriptions (using SSE)
- Logging using Pino
- Improved TypeScript Support
- Try out experimental GraphQL features such as
@defer
and@stream
-
de1693e: trigger release
Minor Changes
-
6750eff: rename
GraphQLServerError
toGraphQLYogaError
. -
0edf1f8: feat: options for GraphiQL
-
d414f95: BREAKING Set
maskedErrors
value totrue
by default for safer defaults.BREAKING Remove
disableIntrospection
. Please useuseDisableIntrospection
from@envelop/disable-introspection
instead. -
36af58e: export renderGraphiQL function
-
bea2dcc: align envelop types
-
fc1f2c7: make options optional
-
fb894da: Rename createGraphQLServer to createServer
-
1a20e1e: Export everything from @envelop/core and export GraphQLFile scalar
-
d078e84: Drop fastify and use node-http package
-
6d60ebf: add tabs to GraphiQL
-
9554f81: Add PubSub utility.
-
95e0ac0: feat: remove unnecessary Upload scalar types
-
dcaea56: add missing tslib dependency
Patch Changes
-
6effd5d: fix(node): handle response cancellation correctly
-
3d54829: enhance: move W3C changes
-
0edf1f8: feat(cli): binds GraphQL Config to GraphQL Yoga
-
a10a16c: Node Server implementation has been moved to
@graphql-yoga/node
package.CLI implementation has been moved to
graphql-yoga
package. -
5b6f025: feat(yoga-cli): fallback to default schema and add mock parameter
-
Updated dependencies [d414f95]
-
Updated dependencies [133f8e9]
-
Updated dependencies [14c93a7]
-
Updated dependencies [ec777b1]
-
Updated dependencies [dcaea56]
-
Updated dependencies [b0b244b]
-
Updated dependencies [cfec14b]
-
Updated dependencies [433558f]
-
Updated dependencies [3c82b57]
-
Updated dependencies [f5f06f4]
-
Updated dependencies [dcaea56]
-
Updated dependencies [8ab60cf]
-
Updated dependencies [433558f]
-
Updated dependencies [5fba736]
-
Updated dependencies [62e8c07]
-
Updated dependencies [ce60a48]
-
Updated dependencies [a8b619b]
-
Updated dependencies [6d60ebf]
-
Updated dependencies [44ad1b3]
-
Updated dependencies [0424fe3]
-
Updated dependencies [de1693e]
-
Updated dependencies [d60f79f]
-
Updated dependencies [dcaea56]
-
Updated dependencies [daeea82]
-
Updated dependencies [a10a16c]
- @graphql-yoga/node@0.1.0
2.0.0-beta.8
Minor Changes
- 6d60ebf: add tabs to GraphiQL
Patch Changes
- 5b6f025: feat(yoga-cli): fallback to default schema and add mock parameter
- Updated dependencies [3c82b57]
- Updated dependencies [6d60ebf]
- Updated dependencies [0424fe3]
- Updated dependencies [d60f79f]
- @graphql-yoga/node@0.1.0-beta.8
2.0.0-beta.7
Patch Changes
- Updated dependencies [14c93a7]
- Updated dependencies [ec777b1]
- Updated dependencies [8ab60cf]
- @graphql-yoga/node@0.1.0-beta.7
2.0.0-beta.6
Patch Changes
- @graphql-yoga/node@0.1.0-beta.6
2.0.0-beta.5
Patch Changes
- Updated dependencies [cfec14b]
- Updated dependencies [5fba736]
- Updated dependencies [44ad1b3]
- @graphql-yoga/node@0.1.0-beta.5
2.0.0-beta.4
Patch Changes
- Updated dependencies [433558f]
- Updated dependencies [433558f]
- @graphql-yoga/node@0.1.0-beta.4
2.0.0-beta.3
Patch Changes
- Updated dependencies [62e8c07]
- @graphql-yoga/node@0.1.0-beta.3
2.0.0-beta.2
Patch Changes
- Updated dependencies [daeea82]
- @graphql-yoga/node@0.0.1-beta.2
2.0.0-beta.1
Patch Changes
- @graphql-yoga/node@0.0.1-beta.1
2.0.0-beta.0
Major Changes
- de1693e: trigger release
Patch Changes
- Updated dependencies [de1693e]
- @graphql-yoga/node@0.0.1-beta.0
2.0.0-alpha.12
Minor Changes
- dcaea56: add missing tslib dependency
Patch Changes
- Updated dependencies [133f8e9]
- Updated dependencies [dcaea56]
- Updated dependencies [f5f06f4]
- Updated dependencies [dcaea56]
- Updated dependencies [ce60a48]
- Updated dependencies [dcaea56]
- @graphql-yoga/node@0.1.0-alpha.4
2.0.0-alpha.11
Patch Changes
- @graphql-yoga/node@0.1.0-alpha.3
2.0.0-alpha.10
Patch Changes
- Updated dependencies [b0b244b]
- @graphql-yoga/node@0.1.0-alpha.2
2.0.0-alpha.9
Patch Changes
- @graphql-yoga/node@0.1.0-alpha.1
2.0.0-alpha.8
Minor Changes
-
6750eff: rename
GraphQLServerError
toGraphQLYogaError
. -
d414f95: BREAKING Set
maskedErrors
value totrue
by default for safer defaults.BREAKING Remove
disableIntrospection
. Please useuseDisableIntrospection
from@envelop/disable-introspection
instead. -
bea2dcc: align envelop types
-
fc1f2c7: make options optional
Patch Changes
-
6effd5d: fix(node): handle response cancellation correctly
-
a10a16c: Node Server implementation has been moved to
@graphql-yoga/node
package.CLI implementation has been moved to
graphql-yoga
package. -
Updated dependencies [d414f95]
-
Updated dependencies [a10a16c]
- @graphql-yoga/node@0.1.0-alpha.0
2.0.0-alpha.7
Patch Changes
- 3d54829: enhance: move W3C changes
- Updated dependencies [3d54829]
- @graphql-yoga/common@0.2.0-alpha.6
- @graphql-yoga/handler@0.2.0-alpha.3
2.0.0-alpha.6
Minor Changes
- 36af58e: export renderGraphiQL function
Patch Changes
- Updated dependencies [36af58e]
- @graphql-yoga/common@0.2.0-alpha.5
- @graphql-yoga/handler@0.2.0-alpha.2
2.0.0-alpha.5
Patch Changes
- Updated dependencies [d2c2d18]
- @graphql-yoga/common@0.2.0-alpha.4
2.0.0-alpha.4
Minor Changes
- fb894da: Rename createGraphQLServer to createServer
Patch Changes
- Updated dependencies [e99ec3e]
- Updated dependencies [fb894da]
- @graphql-yoga/subscription@0.1.0-alpha.0
- @graphql-yoga/common@0.2.0-alpha.3
2.0.0-alpha.3
Minor Changes
- 0edf1f8: feat: options for GraphiQL
- 1a20e1e: Export everything from @envelop/core and export GraphQLFile scalar
- 9554f81: Add PubSub utility.
- 95e0ac0: feat: remove unnecessary Upload scalar types
Patch Changes
- Updated dependencies [0edf1f8]
- Updated dependencies [95e0ac0]
- @graphql-yoga/common@0.2.0-alpha.2
- @graphql-yoga/handler@0.2.0-alpha.1
2.0.0-alpha.2
Patch Changes
- Updated dependencies [5de1acf]
- @graphql-yoga/common@0.2.0-alpha.1
2.0.0-alpha.1
Minor Changes
- d078e84: Drop fastify and use node-http package
Patch Changes
- Updated dependencies [d078e84]
- Updated dependencies [d8f8a81]
- @graphql-yoga/common@0.2.0-alpha.0
- @graphql-yoga/handler@0.2.0-alpha.0
2.0.0-alpha.0
Major Changes
-
b6dd3f1: The goal is to provide a fully-featured, simple to set up, performant and extendable server. Some key features:
- GraphQL-over-HTTP spec compliant
- Extend the GraphQL request flow using
envelop
- File uploads (via GraphQL multipart request specification)
- GraphQL Subscriptions (using SSE)
- Logging using Pino
- Improved TypeScript Support
- Try out experimental GraphQL features such as
@defer
and@stream